Example usage for android.view MenuItem setIntent

List of usage examples for android.view MenuItem setIntent

Introduction

In this page you can find the example usage for android.view MenuItem setIntent.

Prototype

public MenuItem setIntent(Intent intent);

Source Link

Document

Change the Intent associated with this item.

Usage

From source file:de.aw.monma.wertpapier.FragmentWertpapierBuchungenListe.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.awlib_defaultFAB:
        PopupMenu popUpMenu = new PopupMenu(getActivity(), v);
        Menu menu = popUpMenu.getMenu();
        // Aufbau des zugehoerigen Submenues
        for (WPUmsatzArt umsatzArt : WPUmsatzArt.values()) {
            switch (umsatzArt) {
            case Kauf:
            case OthrInc:
            case WP_Einlage:
            case Ausgabe:
                Intent intent = new Intent(getActivity(), ActivityWPUmsatz.class);
                intent.putExtra(ACTION, (Parcelable) Action.DoWertpapierUmsatz);
                intent.putExtra(ACCOUNTID, mAccountID);
                intent.putExtra(WPUMSATZART, umsatzArt);
                MenuItem item = menu.add(Menu.NONE, umsatzArt.getTextResID(), Menu.NONE,
                        umsatzArt.getBeschreibungID());
                item.setIntent(intent);
            }//w ww  . ja  va2s.  c  om
        }
        popUpMenu.show();
        break;
    default:
    }
}

From source file:com.xengar.android.stocktracker.ui.DetailFragment.java

private void finishCreatingMenu(Menu menu) {
    // Retrieve the share main item
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createQuoteHistoryIntent());
}

From source file:co.carlosjimenez.android.currencyalerts.app.DetailActivityFragment.java

private void finishCreatingMenu(Menu menu) {
    // Retrieve the share menu item
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());

    menuItem = menu.findItem(R.id.action_alert);
    MenuTint.colorMenuItem(menuItem, getResources().getColor(R.color.detail_toolbar_icon_color), null);
}

From source file:syncthing.android.ui.LauncherActivity.java

void populateNavigationMenu(Credentials current, boolean goToCurrent) {
    List<Credentials> creds = mSettings.getSavedCredentialsSorted();
    //TODO any way to just clear the devices group?
    mNavigation.getMenu().clear();/*w w  w. ja  v  a2s .com*/
    mNavigation.inflateMenu(R.menu.navigation);
    Menu menu = mNavigation.getMenu();
    for (int ii = 0; ii < creds.size(); ii++) {
        Credentials c = creds.get(ii);
        MenuItem item = menu.add(R.id.nav_devices, Menu.NONE, ii + 1, c.alias);
        item.setIcon(new BitmapDrawable(getResources(), mIdenticonGenerator.generate(c.id)));
        item.setIntent(new Intent().putExtra(ManageActivity.EXTRA_CREDENTIALS, c));
        if (goToCurrent && c.equals(current)) {
            item.setChecked(true);
        }
    }
    if (goToCurrent) {
        if (current != null) {
            openSession(current);
        } else if (creds.isEmpty()) {
            startWelcomeActivity();
        } else {
            Timber.w("No current device");
            openDrawer(GravityCompat.START);
        }
    }
}

From source file:com.seal.ui.components.CustomWebView.java

private void setupContextMenu() {
    setOnCreateContextMenuListener(new OnCreateContextMenuListener() {

        @Override/*from ww w. j a  v  a 2 s .com*/
        public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
            HitTestResult result = ((WebView) v).getHitTestResult();
            int resultType = result.getType();

            if ((resultType == HitTestResult.ANCHOR_TYPE) || (resultType == HitTestResult.IMAGE_ANCHOR_TYPE)
                    || (resultType == HitTestResult.SRC_ANCHOR_TYPE)
                    || (resultType == HitTestResult.SRC_IMAGE_ANCHOR_TYPE)) {

                MenuItem item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_OPEN, 0, R.string.ContextMenuOpen);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_OPEN, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, 0,
                        R.string.ContextMenuOpenNewTab);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_OPEN_IN_BACKGROUND, 0,
                        R.string.ContextMenuOpenInBackground);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_OPEN_IN_BACKGROUND, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_COPY, 0, R.string.ContextMenuCopyLinkUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_COPY, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_DOWNLOAD, 0, R.string.ContextMenuDownload);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_DOWNLOAD, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_SHARE, 0, R.string.ContextMenuShareLinkUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_SHARE, resultType, result.getExtra()));

                createContributedContextMenu(menu, resultType, result.getExtra());

                menu.setHeaderTitle(result.getExtra());

            } else if (resultType == HitTestResult.IMAGE_TYPE) {

                MenuItem item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_OPEN, 0,
                        R.string.ContextMenuViewImage);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_OPEN, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, 0,
                        R.string.ContextMenuViewImageInNewTab);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_COPY, 0, R.string.ContextMenuCopyImageUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_COPY, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_DOWNLOAD, 0,
                        R.string.ContextMenuDownloadImage);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_DOWNLOAD, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_SHARE, 0,
                        R.string.ContextMenuShareImageUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_SHARE, resultType, result.getExtra()));

                createContributedContextMenu(menu, resultType, result.getExtra());

                menu.setHeaderTitle(result.getExtra());

            } else if (resultType == HitTestResult.EMAIL_TYPE) {

                Intent sendMail = new Intent(Intent.ACTION_VIEW,
                        Uri.parse(WebView.SCHEME_MAILTO + result.getExtra()));

                MenuItem item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_SEND_MAIL, 0,
                        R.string.ContextMenuSendEmail);
                item.setIntent(sendMail);

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_COPY, 0, R.string.ContextMenuCopyEmailUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_COPY, resultType, result.getExtra()));

                item = menu.add(0, SealBrowserActivity.CONTEXT_MENU_SHARE, 0,
                        R.string.ContextMenuShareEmailUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        SealBrowserActivity.CONTEXT_MENU_SHARE, resultType, result.getExtra()));

                createContributedContextMenu(menu, resultType, result.getExtra());

                menu.setHeaderTitle(result.getExtra());

            }
        }
    });
}

From source file:org.jsharkey.oilcan.BrowserActivity.java

public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    MenuItem gourl = menu.add(R.string.browse_gotourl);
    gourl.setIcon(R.drawable.ic_menu_goto);
    gourl.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        public boolean onMenuItemClick(MenuItem item) {
            BrowserActivity.this.startSearch(webview.getUrl(), true, null, false);
            return true;
        }/*w w  w. j  av  a  2  s  . c  om*/
    });

    MenuItem refresh = menu.add(R.string.browse_refresh);
    refresh.setIcon(R.drawable.ic_menu_refresh);
    refresh.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        public boolean onMenuItemClick(MenuItem item) {
            webview.reload();
            return true;
        }
    });

    MenuItem scripts = menu.add(R.string.browse_manage);
    scripts.setIcon(android.R.drawable.ic_menu_agenda);
    scripts.setIntent(new Intent(BrowserActivity.this, ScriptListActivity.class));

    MenuItem example = menu.add(R.string.browse_example);
    example.setIcon(R.drawable.ic_menu_bookmark);
    example.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        public boolean onMenuItemClick(MenuItem item) {
            final String[] examples = BrowserActivity.this.getResources().getStringArray(R.array.list_examples);
            new AlertDialog.Builder(BrowserActivity.this).setTitle(R.string.browse_example_title)
                    .setItems(examples, new OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            BrowserActivity.this.loadNewPage(examples[which]);
                        }
                    }).create().show();

            return true;
        }
    });

    return true;
}

From source file:com.acrutiapps.browser.ui.components.CustomWebView.java

private void setupContextMenu() {
    setOnCreateContextMenuListener(new OnCreateContextMenuListener() {

        @Override/* w  w w  .ja  v a2 s. c o m*/
        public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
            HitTestResult result = ((WebView) v).getHitTestResult();
            int resultType = result.getType();

            if ((resultType == HitTestResult.ANCHOR_TYPE) || (resultType == HitTestResult.IMAGE_ANCHOR_TYPE)
                    || (resultType == HitTestResult.SRC_ANCHOR_TYPE)
                    || (resultType == HitTestResult.SRC_IMAGE_ANCHOR_TYPE)) {

                MenuItem item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_OPEN, 0, R.string.ContextMenuOpen);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_OPEN, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, 0,
                        R.string.ContextMenuOpenNewTab);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_OPEN_IN_BACKGROUND, 0,
                        R.string.ContextMenuOpenInBackground);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_OPEN_IN_BACKGROUND, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_COPY, 0, R.string.ContextMenuCopyLinkUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_COPY, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_DOWNLOAD, 0, R.string.ContextMenuDownload);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_DOWNLOAD, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_SHARE, 0, R.string.ContextMenuShareLinkUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_SHARE, resultType, result.getExtra()));

                createContributedContextMenu(menu, resultType, result.getExtra());

                menu.setHeaderTitle(result.getExtra());

            } else if (resultType == HitTestResult.IMAGE_TYPE) {

                MenuItem item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_OPEN, 0,
                        R.string.ContextMenuViewImage);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_OPEN, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, 0,
                        R.string.ContextMenuViewImageInNewTab);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_OPEN_IN_NEW_TAB, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_COPY, 0, R.string.ContextMenuCopyImageUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_COPY, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_DOWNLOAD, 0,
                        R.string.ContextMenuDownloadImage);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_DOWNLOAD, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_SHARE, 0,
                        R.string.ContextMenuShareImageUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_SHARE, resultType, result.getExtra()));

                createContributedContextMenu(menu, resultType, result.getExtra());

                menu.setHeaderTitle(result.getExtra());

            } else if (resultType == HitTestResult.EMAIL_TYPE) {

                Intent sendMail = new Intent(Intent.ACTION_VIEW,
                        Uri.parse(WebView.SCHEME_MAILTO + result.getExtra()));

                MenuItem item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_SEND_MAIL, 0,
                        R.string.ContextMenuSendEmail);
                item.setIntent(sendMail);

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_COPY, 0, R.string.ContextMenuCopyEmailUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_COPY, resultType, result.getExtra()));

                item = menu.add(0, TintBrowserActivity.CONTEXT_MENU_SHARE, 0,
                        R.string.ContextMenuShareEmailUrl);
                item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                        TintBrowserActivity.CONTEXT_MENU_SHARE, resultType, result.getExtra()));

                createContributedContextMenu(menu, resultType, result.getExtra());

                menu.setHeaderTitle(result.getExtra());

            }
        }
    });
}

From source file:com.acrutiapps.browser.ui.components.CustomWebView.java

private void createContributedContextMenu(ContextMenu menu, int hitTestResult, String url) {
    if (!isPrivateBrowsingEnabled()) {
        MenuItem item;

        List<AddonMenuItem> contributedItems = Controller.getInstance().getAddonManager()
                .getContributedLinkContextMenuItems(this, hitTestResult, url);
        for (AddonMenuItem contribution : contributedItems) {
            item = menu.add(0, contribution.getAddon().getMenuId(), 0, contribution.getMenuItem());
            item.setIntent(createIntent(Constants.ACTION_BROWSER_CONTEXT_MENU,
                    contribution.getAddon().getMenuId(), hitTestResult, url));
        }/*from   w  w w .  ja v  a  2s .  co m*/
    }
}

From source file:org.tigase.mobile.roster.RosterFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    final Long id = extractId(menuInfo);

    if (id != null && id != -1) {
        RosterItem r = getJid(id);//from   w  w w  . ja  v a  2  s  .  c  o m
        final boolean sessionEstablished = r != null && isSessionEstablished(r.getSessionObject());

        MenuInflater m = new MenuInflater(getActivity());
        try {
            Presence p = r.getSessionObject().getPresence().getBestPresence(r.getJid());
            if (p != null && p.getType() == null) {
                SubMenu sm = menu.addSubMenu(R.id.contactsOnlineGroup, Menu.NONE, Menu.NONE, "Chat with");
                prepareResources(sm, id);
            }
        } catch (Exception e) {
        }
        m.inflate(R.menu.roster_context_menu, menu);

        JaxmppCore jaxmpp = this.getMulti().get(r.getSessionObject());
        if (jaxmpp != null && sessionEstablished) {
            GeolocationModule module = jaxmpp.getModule(GeolocationModule.class);
            if (module != null) {
                ContentValues location = module.getLocationForJid(r.getJid());
                if (location != null) {
                    Double lat = location.getAsDouble(GeolocationTableMetaData.FIELD_LAT);
                    Double lon = location.getAsDouble(GeolocationTableMetaData.FIELD_LON);
                    String uriStr = null;
                    if (lon == null || lat == null) {
                        String str = "";
                        String val = location.getAsString(GeolocationTableMetaData.FIELD_STREET);
                        Log.v(TAG, "Street = " + String.valueOf(val));
                        if (val != null) {
                            str += val;
                        }
                        val = location.getAsString(GeolocationTableMetaData.FIELD_LOCALITY);
                        Log.v(TAG, "Locality = " + String.valueOf(val));
                        if (val != null) {
                            if (!isEmpty(str)) {
                                str += " ";
                            }
                            str += val;
                        }
                        val = location.getAsString(GeolocationTableMetaData.FIELD_COUNTRY);
                        Log.v(TAG, "Country = " + String.valueOf(val));
                        if (val != null) {
                            if (!isEmpty(str)) {
                                str += " ";
                            }
                            str += val;
                        }

                        if (!isEmpty(str)) {
                            str = str.replace(' ', '+');
                            uriStr = "geo:0,0?q=" + str;
                        }
                    } else {
                        Log.v(TAG, "latitude = " + String.valueOf(lat));
                        Log.v(TAG, "longitude = " + String.valueOf(lon));
                        uriStr = "geo:" + String.valueOf(lat) + "," + String.valueOf(lon) + "?z=14";
                    }
                    if (uriStr != null) {
                        uriStr += "(" + RosterDisplayTools.getDisplayName(r) + ")";
                        Log.v(TAG, "created geolocation uri = " + uriStr);
                        Uri uri = Uri.parse(uriStr);
                        MenuItem item = menu.add(R.string.geolocation_show);
                        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                        item.setIntent(intent);
                    }
                }
            }
        }

        menu.setGroupVisible(R.id.contactsOnlineGroup, sessionEstablished);
    }
}

From source file:com.jimandreas.popularmovies.MovieDetailFragment.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (cursor != null && cursor.moveToFirst()) {
        mCursor = cursor;//  w  w  w . j a va 2  s  .co  m
        ViewParent vp = getView().getParent();
        if (vp instanceof CardView) {
            ((View) vp).setVisibility(View.VISIBLE);
        }

        String movie_title = cursor.getString(COL_TITLE);
        mMDTitleView.setText(movie_title);
        mMDTitleView.setContentDescription(movie_title);

        String movie_poster_path = cursor.getString(COL_POSTER_PATH);
        Picasso.with(getContext()).load("http://image.tmdb.org/t/p/w185/" + movie_poster_path)
                .into(mMDPosterView);

        //            Glide.with(getContext())
        //                    .load("http://image.tmdb.org/t/p/w185/" + movie_poster_path)
        //                    // .fitCenter()
        //
        //                    .error(R.drawable.ic_no_wifi)
        //                    .override(100, 150)
        //                    // .fitCenter()
        //                    // .centerCrop()   // results in cropping - not acceptable
        //                    .dontAnimate()  // this causes jank if used instead of crossFade
        //                    // .crossFade(1)
        //                    .placeholder(R.drawable.ic_loading)

        //                    .into(mMDPosterView);

        String release_date = cursor.getString(COL_RELEASE_DATE);
        mMDYear.setText(release_date);
        mMDYear.setContentDescription("The Movie was released on " + release_date);

        String synopsis = cursor.getString(COL_OVERVIEW);
        mMDSynopsis.setText(synopsis);
        mMDSynopsis.setContentDescription(synopsis);

        String vote_average = cursor.getString(COL_VOTE_AVERAGE);
        String vote_count = cursor.getString(COL_VOTE_COUNT);
        mMDSynopsis
                .setContentDescription("The movie is rated " + vote_average + " from " + vote_count + " votes");

        String combo = vote_average + "/10 (" + vote_count + ")";
        mMDRatingAndVotes.setText(combo);
        mMDRatingAndVotes.setContentDescription("\u00A0");

        /*
         * check the favorites boolean status and display the
         * matching heart.
         */
        int favorite_state = cursor.getInt(COL_FAVORITE);
        if (favorite_state == 1) {
            mMDFavoriteButton.setImageResource(R.drawable.ic_favorite_selected);
            mMDFavoriteButton.setContentDescription("It is set to a favorite movie");
        } else {
            mMDFavoriteButton.setImageResource(R.drawable.ic_favorite_unselected);
            mMDFavoriteButton.setContentDescription("The favorite is not set");
        }

        mMDPlay1.setContentDescription("Play trailer");
        mMDPlay2.setContentDescription("Play trailer");
        mMDPlay3.setContentDescription("Play trailer");
        mMDRev1.setContentDescription("Read review");
        mMDRev2.setContentDescription("Read review");
        mMDRev3.setContentDescription("Read review");

        /*
         * if all the extra data hasn't been loaded yet,
         * then post a circle flavored "progress bar"
         * and initiate the task to download the data.
         */
        Integer movie_details_loaded = cursor.getInt(COL_DETAILS_LOADED);
        if (movie_details_loaded == 0) {

            mMDLoadProgress.setVisibility(View.VISIBLE);
            /*
             * start a task to fetch the movie details in the background, and update the movie
             * table in the ContentProvider with the details
             */
            FetchMovieListTask fetchMovieListTask = new FetchMovieListTask(getActivity());
            String myname = cursor.getString(COL_THIS_TABLE_NAME);
            Integer movie_id = cursor.getInt(COL_MOVIE_ID);
            String todo;
            if (myname.contains("popular")) {
                todo = fetchMovieListTask.FETCH_POPULAR_MOVIE_DETAILS;
            } else {
                todo = fetchMovieListTask.FETCH_TOP_RATED_MOVIE_DETAILS;
            }
            fetchMovieListTask.execute(todo, String.valueOf(movie_id));

            /*
             * whack all the elements (trailers and reviews)
             * for which we don't have yet data...
             */
            setGoneStatus();

            /*
             * invoke the Power of the Android Ring!
             */
            //                mTheMasterGridLayout.invalidate();
            //                mTheMasterGridLayout.setRowCount(10);  //  oops didn't work!

            mTM.buildPopularMoviesListToUpdate();
            // no more work to do now
            return;
        }

        /*
         * hey we have data!
         */
        mMDLoadProgress.setVisibility(View.INVISIBLE);
        /*
         * The Indeterminate Ring of Waiting has been banished!
         * Bring back the minions to do our detail bidding!
         */

        // TODO: try swapping two different GridLayouts - one with the Trailers and Reviews
        //            mTheMasterGridLayout.invalidate();
        //            mTheMasterGridLayout.setRowCount(25);

        // TODO: figure out formatted string for running time for translation

        String running_time = cursor.getString(COL_RUNTIME);
        if (running_time != null) {
            mMDRunningtime.setText(running_time + " minutes");
        }

        String trailer1_name = cursor.getString(COL_TRAILER1_NAME);
        String trailer2_name = cursor.getString(COL_TRAILER2_NAME);
        String trailer3_name = cursor.getString(COL_TRAILER3_NAME);

        if (trailer1_name.length() != 0) {
            mMDTrailer1.setText(trailer1_name);
            mMDTrailer1.setVisibility(View.VISIBLE);
            mMDPlay1.setVisibility(View.VISIBLE);
            mMDTrailers.setVisibility(View.VISIBLE); // don't forget the section header!
        }
        if (trailer2_name.length() != 0) {
            mMDTrailer2.setText(trailer2_name);
            mMDTrailer2.setVisibility(View.VISIBLE);
            mMDPlay2.setVisibility(View.VISIBLE);
        }
        if (trailer3_name.length() != 0) {
            mMDTrailer3.setText(trailer3_name);
            mMDTrailer3.setVisibility(View.VISIBLE);
            mMDPlay3.setVisibility(View.VISIBLE);
        }

        int col = cursor.getColumnIndex(MoviePopular.COLUMN_REVIEW_NAME);
        int col2 = COL_REVIEW_NAME;

        String review1_name = cursor.getString(COL_REVIEW_NAME);
        String review2_name = cursor.getString(COL_REVIEW_NAME2);
        String review3_name = cursor.getString(COL_REVIEW_NAME3);

        if (review1_name.length() != 0) {
            mMovieReview1.setText(review1_name);
            mMovieReview1.setVisibility(View.VISIBLE);
            mMDReviews.setVisibility(View.VISIBLE);
            mMDRev1.setVisibility(View.VISIBLE);
        }
        if (review2_name.length() != 0) {
            mMovieReview2.setText(review2_name);
            mMovieReview2.setVisibility(View.VISIBLE);
            mMDRev2.setVisibility(View.VISIBLE);
        }
        if (review3_name.length() != 0) {
            mMovieReview3.setText(review3_name);
            mMovieReview3.setVisibility(View.VISIBLE);
            mMDRev3.setVisibility(View.VISIBLE);
        }
    }

    String movie_title = mCursor.getString(COL_TITLE);
    String trailer1_name = mCursor.getString(COL_TRAILER1_NAME);
    String url1 = mCursor.getString(COL_TRAILER1);

    // TODO: isolate strings for localization
    String prefix = "http://www.youtube.com/watch?v=";

    mShareDetails = "Here is an interesting movie!\n" + movie_title
            + "\nand here is a youtube video to check out:\n" + trailer1_name + "\n" + prefix + url1;

    if (mMenu != null) {
        MenuItem menuItem = mMenu.findItem(R.id.action_share);
        if (menuItem != null) {
            menuItem.setIntent(createShareForecastIntent());
        }
    }

}