digrach

MenuMaker

May 29th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import android.content.Context;
  2. import android.content.Intent;
  3. import android.view.MenuItem;
  4.  
  5. public class MenuMaker {
  6.  
  7.     public static Intent getAct(Context c, MenuItem mi) { // http://developer.android.com/guide/topics/resources/menu-resource.html
  8.         int id = mi.getItemId();
  9.         Intent i = null;
  10.         if (id == R.id.action_drawingactivity) {
  11.             i = new Intent(c,DrawingActivity.class);
  12.         }
  13.         if (id == R.id.action_settings) {
  14.             i = null;
  15.         }
  16.  
  17.         return i;
  18.  
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment