Java Code Examples for android.view.MenuItem.setIntent()

The following are Jave code examples for showing how to use setIntent() of the android.view.MenuItem class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: GxIconDIY   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.menu_whats_new) {
        sp.save("hideLatest" + PkgUtil.getAppVer(this, "%1$s"), true);
        item.setIntent(new Intent(this, WhatsNewActivity.class));
        return super.onOptionsItemSelected(item);
    } else if (id == R.id.menu_search) {
        item.setIntent(new Intent(this, SearchActivity.class));
        return super.onOptionsItemSelected(item);
    } else if (id == R.id.menu_apply) {
        (new ApplyDialog()).show(getSupportFragmentManager(), "applyDialog");
        return true;
    } else if (id == R.id.menu_about) {
        item.setIntent(new Intent(this, AboutActivity.class));
        return super.onOptionsItemSelected(item);
    }
    return super.onOptionsItemSelected(item);
}
 
Example 2
Project: GxIconAndroid   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.menu_whats_new) {
        sp.save("hideLatest" + PkgUtil.getAppVer(this, "%1$s"), true);
        item.setIntent(new Intent(this, WhatsNewActivity.class));
        return super.onOptionsItemSelected(item);
    } else if (id == R.id.menu_search) {
        item.setIntent(new Intent(this, SearchActivity.class));
        return super.onOptionsItemSelected(item);
    } else if (id == R.id.menu_apply) {
        (new ApplyDialog()).show(getSupportFragmentManager(), "applyDialog");
        return true;
    } else if (id == R.id.menu_about) {
        item.setIntent(new Intent(this, AboutActivity.class));
        return super.onOptionsItemSelected(item);
    }
    return super.onOptionsItemSelected(item);
}
 
Example 3
Project: NanoIconPack   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.menu_whats_new) {
        sp.save("hideLatest" + PkgUtil.getAppVer(this, "%1$s"), true);
        item.setIntent(new Intent(this, WhatsNewActivity.class));
        return super.onOptionsItemSelected(item);
    } else if (id == R.id.menu_search) {
        item.setIntent(new Intent(this, SearchActivity.class));
        return super.onOptionsItemSelected(item);
    } else if (id == R.id.menu_apply) {
        (new ApplyDialog()).show(getSupportFragmentManager(), "applyDialog");
        return true;
    } else if (id == R.id.menu_about) {
        item.setIntent(new Intent(this, AboutActivity.class));
        return super.onOptionsItemSelected(item);
    }
    return super.onOptionsItemSelected(item);
}
 
Example 4
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 5
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 6
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 7
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 8
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 9
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 10
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return super.onCreateOptionsMenu(menu);
}
 
Example 11
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 12
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 13
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 14
Project: android-dev-challenge   File: DetailActivity.java   View Source Code Vote up 5 votes
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.detail, menu);
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
    return true;
}
 
Example 15
Project: SSTVEncoder2   File: MainActivity.java   View Source Code Vote up 5 votes
private void createModesMenu(Menu menu) {
    SubMenu modesSubMenu = menu.findItem(R.id.action_modes).getSubMenu();
    IModeInfo[] modeInfoList = mEncoder.getModeInfoList();
    for (IModeInfo modeInfo : modeInfoList) {
        MenuItem item = modesSubMenu.add(modeInfo.getModeName());
        Intent intent = new Intent();
        intent.putExtra(CLASS_NAME, modeInfo.getModeClassName());
        item.setIntent(intent);
    }
}
 
Example 16
Project: Udacity_Sunshine   File: DetailFragment.java   View Source Code Vote up 4 votes
private void finishCreatingMenu(Menu menu) {
    // Retrieve the share menu item
    MenuItem menuItem = menu.findItem(R.id.action_share);
    menuItem.setIntent(createShareForecastIntent());
}
 
Example 17
Project: letv   File: ShareCompat.java   View Source Code Vote up 4 votes
public void configureMenuItem(MenuItem item, IntentBuilder shareIntent) {
    item.setIntent(shareIntent.createChooserIntent());
}
 
Example 18
Project: letv   File: ShareCompat.java   View Source Code Vote up 4 votes
public void configureMenuItem(MenuItem item, IntentBuilder shareIntent) {
    ShareCompatICS.configureMenuItem(item, shareIntent.getActivity(), shareIntent.getIntent());
    if (shouldAddChooserIntent(item)) {
        item.setIntent(shareIntent.createChooserIntent());
    }
}
 
Example 19
Project: boohee_v5.6   File: ShareCompat.java   View Source Code Vote up 4 votes
public void configureMenuItem(MenuItem item, IntentBuilder shareIntent) {
    item.setIntent(shareIntent.createChooserIntent());
}
 
Example 20
Project: boohee_v5.6   File: ShareCompat.java   View Source Code Vote up 4 votes
public void configureMenuItem(MenuItem item, IntentBuilder shareIntent) {
    ShareCompatICS.configureMenuItem(item, shareIntent.getActivity(), shareIntent.getIntent());
    if (shouldAddChooserIntent(item)) {
        item.setIntent(shareIntent.createChooserIntent());
    }
}