List of usage examples for android.content Intent setClass
public @NonNull Intent setClass(@NonNull Context packageContext, @NonNull Class<?> cls)
From source file:com.cssweb.android.common.FairyUI.java
/** * ??\//from w w w . j a va 2 s .c o m * * @param paramInt * @param paramContext * @return */ public static Intent genIsLoginIntent(int paramInt, int paramInt2, Context paramContext) { Intent localIntent = new Intent(); if (genIsActiveIntent(paramInt, paramInt2, paramContext)) { if (!TradeUtil.checkUserLogin()) {// ? localIntent.putExtra("menu_id", paramInt); localIntent.setClass(paramContext, LoginActivity.class); } else { localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); String orgid = TradeUser.getInstance().getOrgid(); switch (paramInt2) { case Global.NJZQ_JLP_JYYH: localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.putExtra("menu_id", paramInt2); if (1 == TradeUser.getInstance().getLoginType()) { localIntent = null; } else { localIntent.setClass(paramContext, LoginActivity.class); } break; case Global.NJZQ_WTJY: localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.putExtra("menu_id", paramInt2); if (orgid == null || "".equals(orgid)) { localIntent.setClass(paramContext, LoginActivity.class); } else { localIntent.setClass(paramContext, JlpActivity.class); } break; case Global.NJZQ_WTJY_TWO: localIntent.putExtra("menu_id", Global.NJZQ_WTJY_GP_THREE); localIntent.setClass(paramContext, FundActivity.class); break; case Global.QUOTE_USERSTK: localIntent.putExtra("requestType", 1); localIntent.setClass(paramContext, PersonalStock.class); break; case Global.QUOTE_WARNING: case Global.NJZQ_HQBJ_HQYJ: if (TradeUser.getInstance().getLoginType() == 3) { localIntent.putExtra("menu_id", paramInt); localIntent.setClass(paramContext, LoginActivity.class); } else localIntent.setClass(paramContext, QuoteWarning.class); break; case Global.NJZQ_ZXHD_EGHT: localIntent.putExtra("menu_id", Global.NJZQ_ZXHD_EGHT); localIntent.setClass(paramContext, VistualTrade.class); break; case Global.QUOTE_PAIMING: localIntent.putExtra("requestType", 0); localIntent.setClass(paramContext, PaiMing.class); break; case Global.QUOTE_DAPAN: localIntent.putExtra("requestType", 2); localIntent.setClass(paramContext, DaPan.class); break; case Global.NJZQ_HQBJ_QQSC_WHSC: localIntent.putExtra("menu_id", Global.NJZQ_HQBJ_QQSC_WHSC); localIntent.setClass(paramContext, GlobalMarket.class); break; case Global.QUOTE_FENLEI: localIntent.putExtra("requestType", 2); localIntent.setClass(paramContext, FenLei.class); break; case Global.QUOTE_STOCK: localIntent.putExtra("type", 0); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.QUOTE_BOND: localIntent.putExtra("type", 1); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.QUOTE_MONETARY: localIntent.putExtra("type", 2); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.QUOTE_MIX: localIntent.putExtra("type", 3); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.SUN_PRIVATE: localIntent.putExtra("type", 4); localIntent.setClass(paramContext, SunPrivate.class); break; case Global.HK_MAINBOARD: // ? Bundle bundle = new Bundle(); bundle.putInt("stocktype", 101); bundle.putInt("flag", 1); localIntent.putExtras(bundle); localIntent.setClass(paramContext, HKMainboard.class); break; case Global.HK_CYB: // ? Bundle bundle2 = new Bundle(); bundle2.putInt("stocktype", 102); bundle2.putInt("flag", 2); localIntent.putExtras(bundle2); localIntent.setClass(paramContext, HKMainboard.class); break; case Global.ZJS:// localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); localIntent.setClass(paramContext, ZJS.class); Bundle extras = new Bundle(); extras.putString("market", "cffex"); extras.putString("exchange", "cf"); extras.putString("title", ""); localIntent.putExtras(extras); break; case Global.SDZ:// ,, localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); localIntent.setClass(paramContext, QHSCBaseActivity.class); break; case Global.QUOTE_HSZS: localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); localIntent.setClass(paramContext, HSZS.class); break; case Global.QUOTE_KLINE: localIntent.setClass(paramContext, KLineActivity.class); break; case Global.QUOTE_FENSHI: localIntent.putExtra("exchange", CssSystem.exchange); localIntent.putExtra("stockcode", CssSystem.stockcode); localIntent.putExtra("stockname", CssSystem.stockname); localIntent.setClass(paramContext, TrendActivity.class); break; case Global.NJZQ_ZXHD_KHJL: localIntent.putExtra("pos", Global.NJZQ_ZXHD_KHJL); localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.setClass(paramContext, WebViewDisplay.class); break; case Global.NJZQ_ZXHD_TZGW: if (TradeUser.getInstance().getLoginType() == 3) { localIntent.putExtra("menu_id", paramInt); localIntent.setClass(paramContext, LoginActivity.class); } else { localIntent.putExtra("pos", Global.NJZQ_ZXHD_TZGW); localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.setClass(paramContext, WebViewDisplay.class); } break; } } } else { localIntent.putExtra("menu_id", paramInt); if (paramInt == Global.NJZQ_WTJY) { localIntent.putExtra("isChangeBtn", true); } localIntent.setClass(paramContext, SMSJHActivity.class); } return localIntent; }
From source file:cn.studyjams.s2.sj0132.bowenyan.mygirlfriend.nononsenseapps.notepad.ui.list.ActivityList.java
@Override public void openSettings() { Intent intent = new Intent(); intent.setClass(this, ActivitySettings.class); startActivity(intent);/*from ww w . j a v a2s . c om*/ }
From source file:com.sq.jzq.company.MyDataCompanyActivity.java
@Override public void widgetClick(View v) { switch (v.getId()) { case R.id.iv_my_head: Intent intent = new Intent(); intent.setClass(MyDataCompanyActivity.this, SelectPicActivity.class); intent.putExtra("type", "icon"); startActivityForResult(intent, 7); break;// www .j a v a 2s . c om default: break; } }
From source file:com.mattprecious.notisync.fragment.StandardProfileListFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.standard_list, container, false); ArrayList<ProfileType> titles = new ArrayList<ProfileType>(); titles.add(ProfileType.TEXT);//from ww w. j a v a 2s .c om titles.add(ProfileType.PHONE); titles.add(ProfileType.GTALK); listAdapter = new StandardProfileAdapter(getActivity(), titles); listView = (ListView) view.findViewById(R.id.list); listView.setAdapter(listAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ProfileType type = (ProfileType) parent.getItemAtPosition(position); Intent intent = new Intent(); intent.setClass(getActivity(), StandardProfileActivity.class); intent.putExtra(StandardProfileActivity.EXTRA_TYPE, type); getActivity().startActivityForResult(intent, MainActivity.REQUEST_CODE_EDIT_PROFILE); } }); return view; }
From source file:com.miz.mizuu.UnidentifiedTvShows.java
private void identifySelectedFiles() { SparseBooleanArray sba = mList.getCheckedItemPositions(); ArrayList<String> filepaths = new ArrayList<String>(); for (int i = 0; i < sba.size(); i++) { filepaths.add(mFilepaths.get(sba.keyAt(i)).getFullFilepath()); }/*from www.ja v a 2s. c o m*/ Intent i = new Intent(); i.setClass(this, IdentifyTvShowEpisode.class); i.putExtra("filepaths", filepaths); i.putExtra("showTitle", ""); i.putExtra("showId", ""); // Unidentified startActivity(i); }
From source file:com.geodoer.bodymotiondetector.MainActivity.java
private void setupDrawerContent(NavigationView navigationView) { navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override//www . ja v a 2 s. co m public boolean onNavigationItemSelected(MenuItem menuItem) { menuItem.setChecked(true); mDrawerLayout.closeDrawers(); Intent thisIntent = new Intent(); switch (menuItem.getItemId()) { case R.id.navm_home: thisIntent.setClass(getApplication(), MainActivity.class); startActivity(thisIntent); break; case R.id.navm_messages: break; case R.id.navm_discussion: // break; case R.id.navm_friends: // break; } return true; } }); }
From source file:com.packpublishing.asynchronousandroid.chapter6.WakefulSMSDispatcher.java
@Override public void onReceive(Context context, Intent intent) { // Pass right over to SMSDispatcherIntentService class, the wakeful receiver is // just needed in case the schedule is triggered while the device // is asleep otherwise the service may not have time to trigger the // alarm./*from www. ja v a 2s . c o m*/ intent.setClass(context, SMSDispatcherIntentService.class); WakefulBroadcastReceiver.startWakefulService(context, intent); }
From source file:com.asburymotors.android.disneysocal.service.UtilityReceiver.java
@Override public void onReceive(Context context, Intent intent) { // Pass right over to UtilityService class, the wakeful receiver is // just needed in case the geofence is triggered while the device // is asleep otherwise the service may not have time to trigger the // notification. intent.setClass(context, UtilityService.class); intent.setAction(UtilityService.ACTION_GEOFENCE_TRIGGERED); startWakefulService(context, intent); }
From source file:com.miz.mizuu.UnidentifiedFiles.java
private void identifySelectedFiles() { SparseBooleanArray sba = mList.getCheckedItemPositions(); ArrayList<String> filepaths = new ArrayList<String>(), rowIds = new ArrayList<String>(); for (int i = 0; i < sba.size(); i++) { filepaths.add(episodes.get(sba.keyAt(i)).getFullFilepath()); rowIds.add(episodes.get(sba.keyAt(i)).getRowId()); }//from w w w . ja va 2s . c o m Intent i = new Intent(); i.setClass(this, IdentifyTvShow.class); i.putExtra("rowIds", rowIds.toArray(new String[rowIds.size()])); i.putExtra("rowId", "0"); i.putExtra("files", filepaths.toArray(new String[filepaths.size()])); i.putExtra("showName", ""); i.putExtra("oldShowId", "0"); i.putExtra("includeShowData", true); startActivity(i); }
From source file:com.HumanDecisionSupportSystemsLaboratory.DD_P2P.Orgs.java
@Override public void onListItemClick(ListView list, View v, int position, long id) { Toast.makeText(getActivity(), getListView().getItemAtPosition(position).toString(), Toast.LENGTH_SHORT) .show();/*from w w w .j a v a 2 s. c o m*/ OrgItem[] p = Orgs.orgName; D_Organization o = null; try { if (position >= p.length) return; o = p[position].org; } catch (Exception e) { return; } Intent intent = new Intent(); intent.setClass(getActivity(), OrgDetail.class); Bundle b = new Bundle(); b.putInt(O_ID, position); b.putString(O_GIDH, o.getGIDH()); b.putString(O_LID, o.getLIDstr()); b.putString(O_NAME, Util.getString(orgName[position])); intent.putExtras(b); startActivity(intent); }