Example usage for android.graphics.drawable BitmapDrawable BitmapDrawable

List of usage examples for android.graphics.drawable BitmapDrawable BitmapDrawable

Introduction

In this page you can find the example usage for android.graphics.drawable BitmapDrawable BitmapDrawable.

Prototype

@Deprecated
public BitmapDrawable(java.io.InputStream is) 

Source Link

Document

Create a drawable by decoding a bitmap from the given input stream.

Usage

From source file:org.immopoly.android.helper.ImageListDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not
 * used. Kept private at the moment as its interest is not clear.
 *//*from w  ww .j av  a2  s.c o m*/
private void forceDownload(String url, ImageView imageView, String cookie) {
    // State sanity: url is guaranteed to never be null in
    // DownloadedDrawable and cache keys.
    if (url == null) {
        imageView.setImageDrawable(new BitmapDrawable(fallbackBitmap));
        // stop animation
        imageView.setAnimation(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
        // stop animation
        imageView.setAnimation(loadingAnimation);
        imageView.setImageDrawable(downloadedDrawable);
        task.execute(url, cookie);
    }
}

From source file:com.ankit.touchreview.FinalActivity.java

public void setThemeImage(final String themeimage) {
    new Thread() {
        public void run() {
            try {
                InputStream is = (InputStream) new URL(themeimage).getContent();
                Bitmap bmImg = BitmapFactory.decodeStream(is);
                @SuppressWarnings("deprecation")
                final BitmapDrawable background = new BitmapDrawable(bmImg);
                runOnUiThread(new Runnable() {
                    @SuppressWarnings("deprecation")
                    @Override/* www .j av  a2  s .c  o  m*/
                    public void run() {
                        LinearLayout1.setBackgroundDrawable(background);
                    }
                });
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }.start();
}

From source file:com.github.mobile.gauges.ui.airtraffic.AirTrafficActivity.java

private void subscribeToGaugeChannels(final Collection<String> subscribeIds) {
    if (subscribeIds.isEmpty())
        return;//from  www  .jav a2 s .  c  o  m
    backgroundThread.execute(new Runnable() {

        public void run() {
            final AirTrafficPusherCallback callback = new AirTrafficPusherCallback() {

                @Override
                protected void onHit(final Hit hit) {
                    airTrafficView.addHit(hit);

                    gaugeText.post(new Runnable() {

                        public void run() {
                            String gaugeTitle = gaugeTitles.get(hit.siteId);
                            if (gaugeTitle == null)
                                return;

                            Bitmap bitmap = resourceProvider.getPin(hit.siteId);
                            if (bitmap != null)
                                pinImage.setBackgroundDrawable(new BitmapDrawable(bitmap));
                            else
                                pinImage.setBackgroundDrawable(null);

                            gaugeLocation.setText(getLocation(hit));

                            String title = getTitle(hit);
                            if (title.length() > 0)
                                gaugeText.setText(gaugeTitle + ": " + title);
                            else
                                gaugeText.setText(gaugeTitle);

                        }
                    });
                }
            };
            for (String gaugeId : subscribeIds)
                pusher.subscribe(CHANNEL_PREFIX + gaugeId).bind("hit", callback);
        }
    });
}

From source file:am.hour.beebird.Activity.MainActivity.java

public void updatePersonalInfoLeftDrawer() {
    Bitmap people_logo_DB = DBUtil.getPicFromDB();
    if (people_logo_DB != null)
        iv_ll_person_pic.setBackgroundDrawable(new BitmapDrawable(people_logo_DB));
    else {/*from w  w  w.  jav a 2s.com*/
        iv_ll_person_pic.setBackgroundDrawable(PicLoadUtil.LoadBitmapDrawable(this, R.drawable.fakelogo));
        DBUtil.savePicInDB(PicLoadUtil.LoadBitmap(this, R.drawable.fakelogo));
    }

    tv_ll_person_username.setText(spu.getStringFromSP("USERNAME", ""));
}

From source file:com.androguide.apkreator.MainActivity.java

@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
@Override// w  w  w . j  ava  2s .c  om
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_main);

    /**
     * Before anything we need to check if the config files exist to avoid
     * FC is they don't
     *
     * @see #checkIfConfigExists()
     */
    checkIfConfigExists();

    /**
     * Now it's all good because if no configuration was found we have
     * copied a default one over.
     *
     * @see #checkIfConfigExists()
     */
    setAppConfigInPrefs();

    headers = getPluginTabs();

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.left_drawer);

    /*
       * set a custom shadow that overlays the main content when the drawer
     * opens
     */
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

    /* set up the drawer's list view with items and click listener */
    ArrayAdapter<String> pimpAdapter = new ArrayAdapter<String>(this, R.layout.drawer_list_item,
            mDrawerHeaders);
    mDrawerList.setAdapter(pimpAdapter);
    Log.e("FIRST POS", mDrawerList.getFirstVisiblePosition() + "");
    Log.e("LAST POS", mDrawerList.getLastVisiblePosition() + "");
    View child = mDrawerList.getChildAt(mDrawerList.getFirstVisiblePosition());
    if (child != null && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        child.setBackground(getColouredTouchFeedback());
    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

    /** Set the user-defined ActionBar icon */
    File file = new File(getFilesDir() + "/.APKreator/icon.png");
    if (file.exists()) {
        try {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setHomeButtonEnabled(true);
            Uri iconUri = Uri.fromFile(new File(getFilesDir() + "/.APKreator/icon.png"));
            Bitmap icon = BitmapFactory.decodeFile(iconUri.getPath());
            Drawable ic = new BitmapDrawable(icon);
            getSupportActionBar().setIcon(ic);
        } catch (NullPointerException e) {
            Log.e("NPE", e.getMessage());
        }
    }
    /*
     * ActionBarDrawerToggle ties together the proper interactions between
    * the sliding drawer and the action bar app icon
    */
    mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
            R.string.app_name, /* "open drawer" description for accessibility */
            R.string.app_name /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            invalidateOptionsMenu(); /*
                                     * creates call to
                                     * onPrepareOptionsMenu()
                                     */

        }

        public void onDrawerOpened(View drawerView) {
            invalidateOptionsMenu(); /*
                                     * creates call to
                                     * onPrepareOptionsMenu()
                                     */
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    /** Tabs adapter using the PagerSlidingStrip library */
    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    MyPagerAdapter adapter = new MyPagerAdapter(this.getSupportFragmentManager());
    pager.setAdapter(adapter);
    pager.setOnPageChangeListener(new OnPageChangeListener() {

        @Override
        public void onPageSelected(int arg0) {
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }
    });

    final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4,
            getResources().getDisplayMetrics());
    pager.setPageMargin(pageMargin);

    tabs.setViewPager(pager);
    tabs.setOnPageChangeListener(this);

    changeColor(Color.parseColor(getPluginColor()));
    pager.setOffscreenPageLimit(5);
}

From source file:com.github.jobs.ui.fragment.JobDetailsFragment.java

private void setLogoBackground() {
    if (mJob.getCompanyLogo() == null) {
        return;//from  w ww. j  ava2s.c  o m
    }
    CallbackBitmapObserver rawBitmapObserver = new CallbackBitmapObserver(
            new CallbackBitmapObserver.BitmapCallback() {
                @Override
                public boolean stillNeedsUrl(String uri) {
                    return true;
                }

                @Override
                public void receiveBitmap(String uri, Bitmap bitmap) {
                    if (bitmap == null) {
                        return;
                    }
                    BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmap);
                    bitmapDrawable.setAlpha(50);
                    bitmapDrawable.setGravity(Gravity.CENTER);
                    mBackground.setImageDrawable(bitmapDrawable);
                }
            }, mJob.getCompanyLogo(), new Handler());
    BitmapHelper.getInstance().registerBitmapObserver(getActivity(), rawBitmapObserver);
}

From source file:com.hsbadr.MultiSystem.MainActivity.java

@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
@Override// www.  j  av a2s  . c o  m
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_main);

    /**
     * Before anything we need to check if the config files exist to avoid
     * FC is they don't
     *
     * @see #checkIfConfigExists()
     */
    checkIfConfigExists();

    /**
     * Now it's all good because if no configuration was found we have
     * copied a default one over.
     *
     * @see #checkIfConfigExists()
     */
    setAppConfigInPrefs();

    headers = getPluginTabs();

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.left_drawer);

    /*
       * set a custom shadow that overlays the main content when the drawer
     * opens
     */
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

    /* set up the drawer's list view with items and click listener */
    ArrayAdapter<String> pimpAdapter = new ArrayAdapter<String>(this, R.layout.drawer_list_item,
            mDrawerHeaders);
    mDrawerList.setAdapter(pimpAdapter);
    Log.e("FIRST POS", mDrawerList.getFirstVisiblePosition() + "");
    Log.e("LAST POS", mDrawerList.getLastVisiblePosition() + "");
    View child = mDrawerList.getChildAt(mDrawerList.getFirstVisiblePosition());
    if (child != null && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        child.setBackground(getColouredTouchFeedback());
    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

    /** Set the user-defined ActionBar icon */
    File file = new File(getFilesDir() + "/.MultiSystem/icon.png");
    if (file.exists()) {
        try {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setHomeButtonEnabled(true);
            Uri iconUri = Uri.fromFile(new File(getFilesDir() + "/.MultiSystem/icon.png"));
            Bitmap icon = BitmapFactory.decodeFile(iconUri.getPath());
            Drawable ic = new BitmapDrawable(icon);
            getSupportActionBar().setIcon(ic);
        } catch (NullPointerException e) {
            Log.e("NPE", e.getMessage());
        }
    }
    /*
     * ActionBarDrawerToggle ties together the proper interactions between
    * the sliding drawer and the action bar app icon
    */
    mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
            R.string.app_name, /* "open drawer" description for accessibility */
            R.string.app_name /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            invalidateOptionsMenu(); /*
                                     * creates call to
                                     * onPrepareOptionsMenu()
                                     */

        }

        public void onDrawerOpened(View drawerView) {
            invalidateOptionsMenu(); /*
                                     * creates call to
                                     * onPrepareOptionsMenu()
                                     */
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    /** Tabs adapter using the PagerSlidingStrip library */
    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    pager = (ViewPager) findViewById(R.id.pager);
    MyPagerAdapter adapter = new MyPagerAdapter(this.getSupportFragmentManager());
    pager.setAdapter(adapter);
    pager.setOnPageChangeListener(new OnPageChangeListener() {

        @Override
        public void onPageSelected(int arg0) {
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }
    });

    final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4,
            getResources().getDisplayMetrics());
    pager.setPageMargin(pageMargin);

    tabs.setViewPager(pager);
    tabs.setOnPageChangeListener(this);

    changeColor(Color.parseColor(getPluginColor()));
    pager.setOffscreenPageLimit(5);
}

From source file:cm.aptoide.pt.RemoteInSearch.java

@Override
protected void onListItemClick(ListView l, View v, final int position, long id) {

    super.onListItemClick(l, v, position, id);

    Vector<String> tmp_get = db.getApk(apk_lst.get(position).apkid);

    String tmp_path = this.getString(R.string.icons_path) + apk_lst.get(position).apkid;
    File test_icon = new File(tmp_path);

    LayoutInflater li = LayoutInflater.from(this);
    View view = li.inflate(R.layout.alertscroll, null);
    Builder alrt = new AlertDialog.Builder(this).setView(view);
    final AlertDialog p = alrt.create();
    if (test_icon.exists() && test_icon.length() > 0) {
        p.setIcon(new BitmapDrawable(tmp_path));
    } else {/*from w  w w. ja v  a2s  .  com*/
        p.setIcon(android.R.drawable.sym_def_app_icon);
    }
    p.setTitle(apk_lst.get(position).name);
    TextView t1 = (TextView) view.findViewById(R.id.n11);
    t1.setText(tmp_get.firstElement());
    TextView t2 = (TextView) view.findViewById(R.id.n22);
    t2.setText(tmp_get.get(1));
    TextView t3 = (TextView) view.findViewById(R.id.n33);
    t3.setText(tmp_get.get(2));
    TextView t4 = (TextView) view.findViewById(R.id.n44);
    t4.setText(tmp_get.get(3));
    TextView t5 = (TextView) view.findViewById(R.id.n55);
    String tmpi = db.getDescript(apk_lst.get(position).apkid);
    if (!(tmpi == null)) {
        t5.setText(tmpi);
    } else {
        t5.setText("No info availale on server. Search market by pressing the button below for more info.");
    }

    p.setButton2("Ok", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            return;
        }
    });
    if (tmp_get.get(2).equalsIgnoreCase("\tno\n")) {
        p.setButton(getString(R.string.install), new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                p.dismiss();
                new Thread() {
                    public void run() {
                        String apk_pkg = downloadFile(position);
                        if (apk_pkg == null) {
                            Message msg = new Message();
                            msg.arg1 = 1;
                            download_handler.sendMessage(msg);
                            download_error_handler.sendEmptyMessage(0);
                        } else {
                            installApk(apk_pkg, position);
                        }
                    }
                }.start();
            }
        });
        p.setButton3("Search Market", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                p.dismiss();
                Intent intent = new Intent();
                intent.setAction(android.content.Intent.ACTION_VIEW);
                intent.setData(Uri.parse("market://details?id=" + apk_lst.get(position).apkid));
                startActivity(intent);
            }
        });
    } else {
        p.setButton(getString(R.string.rem), new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                String apk_pkg = apk_lst.get(position).apkid;
                removeApk(apk_pkg, position);
            }
        });
        if (apk_lst.get(position).status == 2) {
            p.setButton3(getString(R.string.update), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    p.dismiss();
                    new Thread() {
                        public void run() {
                            String apk_pkg = downloadFile(position);
                            if (apk_pkg == null) {
                                //Toast.makeText(RemoteInSearch.this, "Could not connect to server!", Toast.LENGTH_LONG).show();
                                Message msg = new Message();
                                msg.arg1 = 1;
                                download_handler.sendMessage(msg);
                                download_error_handler.sendEmptyMessage(0);
                            } else {
                                installApk(apk_pkg, position);
                            }
                        }
                    }.start();
                }
            });
        } else {
            p.setButton3("Search Market", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    p.dismiss();
                    Intent intent = new Intent();
                    intent.setAction(android.content.Intent.ACTION_VIEW);
                    intent.setData(Uri.parse("market://details?id=" + apk_lst.get(position).apkid));
                    startActivity(intent);
                }
            });
        }
    }
    p.show();
}

From source file:andlabs.lounge.lobby.util.parser.PlayParser.java

private Drawable readFileFromInternalStorage(String packageName, int height) {
    InputStream is = null;/*w  w w . jav a2  s .  com*/
    try {
        is = mContext.openFileInput(packageName);
        final Bitmap bitmap = new BitmapDrawable(is).getBitmap();
        int y = (bitmap.getHeight() - height) / 2;

        return new BitmapDrawable(Bitmap.createBitmap(bitmap, 0, y, bitmap.getWidth(), height));
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (is != null) {
            try {
                is.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    return null;
}

From source file:com.mk4droid.IMC_Activities.Fragment_Issue_Details.java

/**
 *    OnCreateView/* ww  w .java  2s.c  o  m*/
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    isVisible = true;

    vfrag_issue_details = inflater.inflate(R.layout.fragment_issue_details, container, false);
    ctx = vfrag_issue_details.getContext();
    resources = setResources();
    mfrag_issue_details = this;

    //========= Image =================
    dbHandler = new DatabaseHandler(ctx);
    imvFull = (ImageView) vfrag_issue_details.findViewById(R.id.imvIssue_Full);

    IssuePic issuepic = dbHandler.getIssuePic(mIssue._id);

    if (issuepic._IssuePicData != null) {
        bmI = My_System_Utils.LowMemBitmapDecoder(issuepic._IssuePicData);
    } else {
        //------- Try to download from internet --------------  
        if (InternetConnCheck.getInstance(ctx).isOnline(ctx) && !mIssue._urlphoto.equals("null")
                && !mIssue._urlphoto.equals("") && mIssue._urlphoto.length() > 0) {

            mIssue._urlphoto = mIssue._urlphoto.replaceFirst("/thumbs", "");
            new ThumbnailTask_IssDetails(mIssue._urlphoto, mIssue._id).execute();
        }
    }

    dbHandler.db.close();

    imvFull.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            dialogZoomIm = null;

            if (FActivity_TabHost.IndexGroup == 0)
                dialogZoomIm = new Dialog(ctx, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
            else if (FActivity_TabHost.IndexGroup == 1)
                dialogZoomIm = new Dialog(FActivity_TabHost.ctx,
                        android.R.style.Theme_Black_NoTitleBar_Fullscreen);

            dialogZoomIm.requestWindowFeature(Window.FEATURE_NO_TITLE);
            dialogZoomIm.setContentView(R.layout.custom_dialog);
            dialogZoomIm.show();
        }
    });

    // ============ Title and id =========
    tv_id = (TextView) vfrag_issue_details.findViewById(R.id.tv_issuenumber);
    TextView tvTitB = (TextView) vfrag_issue_details.findViewById(R.id.tvTitleIssDetB);

    tv_id.setText(Html.fromHtml("<b><big>#</big></b> " + issueId));
    tv_id.setMovementMethod(new ScrollingMovementMethod());

    tvTitB.setText(mIssue._title);

    //=============== Description ======================
    tvDescription = (TextView) vfrag_issue_details.findViewById(R.id.textViewDescription);
    if (!mIssue._description.equals(""))
        tvDescription.setText(mIssue._description);
    else {
        tvDescription.setVisibility(View.GONE);
    }

    // ============== CATEGORY ===============================
    TextView tvCateg = (TextView) vfrag_issue_details.findViewById(R.id.textViewCategContent);

    int iCateg = 0;
    for (int i = 0; i < Service_Data.mCategL.size(); i++)
        if (Service_Data.mCategL.get(i)._id == mIssue._catid) {
            iCateg = i;
            break;
        }

    tvCateg.setText(Service_Data.mCategL.get(iCateg)._name);

    try {
        bmCateg = My_System_Utils.LowMemBitmapDecoder(Service_Data.mCategL.get(iCateg)._icon);
        BitmapDrawable drCateg = new BitmapDrawable(bmCateg);

        tvCateg.setCompoundDrawablesWithIntrinsicBounds(drCateg, null, null, null);
        tvCateg.setCompoundDrawablePadding(10);
        tvCateg.postInvalidate();
    } catch (Exception e) {

    }

    markerOptions = new MarkerOptions().position(new LatLng(mIssue._latitude, mIssue._longitude))
            .title(mIssue._title).icon(BitmapDescriptorFactory.fromBitmap(bmCateg));

    //================  STATUS ================      
    tvStatus_ack = (TextView) vfrag_issue_details.findViewById(R.id.tv_Status_issuedetails_ack);
    tvStatus_cl = (TextView) vfrag_issue_details.findViewById(R.id.tv_Status_issuedetails_cl);

    vStatus_ack = vfrag_issue_details.findViewById(R.id.v_Status_issuedetails_acknow);
    vStatus_cl = vfrag_issue_details.findViewById(R.id.v_Status_issuedetails_cl);

    int CurrStat = mIssue._currentstatus;

    Colora(CurrStat);

    // ============== Time and Author ================
    TextView tvSubmitted = (TextView) vfrag_issue_details.findViewById(R.id.tvSubmitted);

    String TimeStampRep = mIssue._reported.replace("-", "/");

    tvSubmitted.setText(resources.getString(R.string.Submitted) + " "
            + My_Date_Utils.SubtractDate(TimeStampRep, LangSTR) + " " + resources.getString(R.string.ago) + " "
            + resources.getString(R.string.by) + " " + mIssue._username);

    //============== Votes========================
    TextView tvVotes = (TextView) vfrag_issue_details.findViewById(R.id.textViewVotes);
    tvVotes.setText(Integer.toString(mIssue._votes) + " " + resources.getString(R.string.peoplevoted));

    Button btVote = (Button) vfrag_issue_details.findViewById(R.id.buttonVote);
    //-------- Check if state is Ack or Closed then can not vote ----
    if (CurrStat == 2 || CurrStat == 3)
        btVote.setEnabled(false);

    //-------- Check if Has Voted ----------
    DatabaseHandler dbHandler = new DatabaseHandler(ctx);
    HasVotedSW = dbHandler.CheckIfHasVoted(issueId);

    OwnIssue = false;
    if (UserID_STR.length() > 0)
        OwnIssue = dbHandler.checkIfOwnIssue(Integer.toString(issueId), UserID_STR);

    dbHandler.db.close();

    // if has not voted, it is not his issue, and authenticated then able to vote 
    if (!OwnIssue && !HasVotedSW && AuthFlag) {
        btVote.setEnabled(true);
    }

    if (OwnIssue || HasVotedSW) {
        btVote.setEnabled(false);
        btVote.setText(resources.getString(R.string.AlreadyVoted));
    }

    if (!AuthFlag) {
        btVote.setText(resources.getString(R.string.Vote));
    }

    btVote.setOnClickListener(new View.OnClickListener() {
        public void onClick(View arg0) {
            if (InternetConnCheck.getInstance(ctx).isOnline(ctx) && AuthFlag) {
                new AsynchTaskVote().execute();
            } else if (!InternetConnCheck.getInstance(ctx).isOnline(ctx)) {
                Toast.makeText(ctx, resources.getString(R.string.NoInternet), Toast.LENGTH_SHORT).show();
            } else if (!AuthFlag) {
                Toast.makeText(ctx, resources.getString(R.string.OnlyRegistered), Toast.LENGTH_SHORT).show();
            }
        }
    });

    //============ Address - MapStatic - Button Map dynamic ========================
    TextView tvAddr = (TextView) vfrag_issue_details.findViewById(R.id.textViewAddressContent);
    tvAddr.setText(mIssue._address);

    fmap_issdet = SupportMapFragment.newInstance();

    FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.lliss_det_map, fmap_issdet);
    fragmentTransaction.commit();

    // ============ COMMENTS ===========================
    Button btCommentsSW = (Button) vfrag_issue_details.findViewById(R.id.btCommentsSW);

    btCommentsSW.setText(resources.getString(R.string.ViewComments));

    btCommentsSW.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            if (InternetConnCheck.getInstance(ctx).isOnline(ctx)) {
                FragmentTransaction ft2 = getFragmentManager().beginTransaction();

                Fragment_Comments newfrag_comments = new Fragment_Comments(); // Instantiate a new fragment.
                Bundle args = new Bundle();
                args.putInt("issueId", issueId);
                args.putString("issueTitle", mIssue._title);
                newfrag_comments.setArguments(args); // Add the fragment to the activity, pushing this transaction on to the back stack.

                if (FActivity_TabHost.IndexGroup == 0)
                    ft2.add(R.id.flmain, newfrag_comments, "FTAG_COMMENTS");
                else if (FActivity_TabHost.IndexGroup == 1) {
                    ft2.add(R.id.fl_IssuesList_container, newfrag_comments, "FTAG_COMMENTS");
                }

                ft2.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
                ft2.addToBackStack(null);
                ft2.commit();
            } else {
                Toast.makeText(ctx, resources.getString(R.string.NoInternet), Toast.LENGTH_SHORT).show();
            }
        }
    });

    return vfrag_issue_details;
}