Exemplo n.º 1
0
 @SuppressWarnings("unchecked")
 public boolean startActivity(Activity activity, int position) {
   String activityClassName = getActivityClassName();
   if (!Util.nullOrEmptyString(activityClassName)) {
     try {
       Class<? extends Activity> activityClass =
           (Class<? extends Activity>)
               Class.forName(
                   activity.getApplicationContext().getPackageName() + activityClassName);
       Intent intent = new Intent(activity, activityClass);
       intent.putExtra(BitActivity.ACTIVITY_EXTRA, getActivityExtra());
       Bundle bundle = getActivityExtraBundle();
       if (bundle != null) {
         intent.putExtra(BitActivity.ACTIVITY_EXTRA_BUNDLE, bundle);
       }
       intent.putExtra(BitActivity.ACTIVITY_URL, getWebViewUrl());
       intent.putExtra(BitActivity.DRAWER_POSITION, position);
       activity.startActivity(intent);
       return true;
     } catch (ClassNotFoundException e) {
       logger.error(
           "DrawerItem.startActivity exception for activity class name: " + activityClassName, e);
     }
   }
   return false;
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 public ArrayList<DrawerItemField> getItemFields() {
   ArrayList<? extends JSONRecord> list = getJSONRecords("JSONDrawer", "items", "fields");
   if (!Util.nullOrEmptyList(list)) {
     return (ArrayList<DrawerItemField>) list;
   }
   return null;
 }