List of usage examples for android.content Intent setClassName
public @NonNull Intent setClassName(@NonNull String packageName, @NonNull String className)
From source file:net.mypapit.mobile.myrepeater.DisplayMap.java
@Override public void onInfoWindowClick(Marker marker) { MapInfoObject mio = hashMap.get(marker); Intent intent = new Intent(); if (!mio.getIsRepeater()) { intent.setClassName(getApplicationContext(), "net.mypapit.mobile.myrepeater.CallsignDetailsActivity"); HashMap<String, String> inforakanradio = listrakanradio.get(mio.getIndex()); intent.putExtra("callsign", inforakanradio.get("callsign")); intent.putExtra("name", inforakanradio.get("name")); intent.putExtra("qsx", inforakanradio.get("qsx")); intent.putExtra("status", inforakanradio.get("status")); intent.putExtra("distance", inforakanradio.get("distance")); intent.putExtra("time", inforakanradio.get("time")); intent.putExtra("lat", inforakanradio.get("lat")); intent.putExtra("lng", inforakanradio.get("lng")); intent.putExtra("valid", inforakanradio.get("valid")); intent.putExtra("deviceid", inforakanradio.get("deviceid")); intent.putExtra("phoneno", inforakanradio.get("phoneno")); intent.putExtra("client", inforakanradio.get("client")); intent.putExtra("locality", inforakanradio.get("locality")); startActivity(intent);/*from w ww . ja v a2 s.com*/ return; } Repeater rpt = rl.get(mio.getIndex()); intent.setClassName(getApplicationContext(), "net.mypapit.mobile.myrepeater.RepeaterDetailsActivity"); intent.putExtra("Repeater", rpt.toArrayString()); startActivity(intent); }
From source file:org.transdroid.core.gui.navigation.NavigationHelper.java
public void forceOpenInBrowser(Uri link) { Intent intent = new Intent(Intent.ACTION_VIEW).setData(link); List<ResolveInfo> activities = context.getPackageManager().queryIntentActivities(intent, 0); for (ResolveInfo resolveInfo : activities) { if (activities.size() == 1 || (resolveInfo.isDefault && resolveInfo.activityInfo.packageName.equals(context.getPackageName()))) { // There is a default browser; use this intent.setClassName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name); return; }//from w w w. j av a2 s.c om } // No default browser found: open chooser try { context.startActivity(Intent.createChooser(intent, "Open...")); } catch (Exception e) { // No browser installed; consume and fail silently } }
From source file:com.gnuroot.debian.GNURootMain.java
private void setupFirstHalf() { errOcc = false;/*w ww . j av a 2 s.com*/ expectingResult = true; Intent downloadIntent = new Intent(); downloadIntent.addCategory(Intent.CATEGORY_DEFAULT); downloadIntent.setClassName("com.gnuroot.debian", "com.gnuroot.debian.GNURootDownloaderActivity"); startActivityForResult(downloadIntent, 0); }
From source file:nz.co.wholemeal.christchurchmetro.FavouritesActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.favourites_list); if (stops.size() == 0) { initFavourites();/*from ww w .ja v a 2 s .c om*/ } stopAdapter = new StopAdapter(this, R.layout.stop_list_item, stops); setListAdapter(stopAdapter); ListView lv = getListView(); /* Enables the long click in the ListView to be handled in this Activity */ registerForContextMenu(lv); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(); Stop stop = (Stop) stops.get(position); if (stop == null) { Log.e(TAG, "Didn't get a stop"); finish(); } intent.putExtra("platformTag", stop.platformTag); intent.setClassName("nz.co.wholemeal.christchurchmetro", "nz.co.wholemeal.christchurchmetro.PlatformActivity"); startActivity(intent); } }); /* * This will contain return non null if we received an orientation change */ asyncLoadPlatforms = (AsyncLoadPlatforms) getLastNonConfigurationInstance(); if (asyncLoadPlatforms != null) { loadDataDialogShown = true; initProgressDialog(); asyncLoadPlatforms.attach(this); } SharedPreferences preferences = getSharedPreferences(PlatformActivity.PREFERENCES_FILE, 0); if (preferences.getLong("lastDataLoad", -1) == -1 && !loadDataDialogShown) { showDialog(DIALOG_LOAD_DATA); } }
From source file:se.droidgiro.scanner.CaptureActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.about: { Intent intent = new Intent(this, About.class); startActivity(intent);// w w w .j a v a 2s . c o m break; } case R.id.settings: { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.setClassName(this, PreferencesActivity.class.getName()); startActivity(intent); break; } } return super.onOptionsItemSelected(item); }
From source file:com.fvd.nimbus.MainActivity.java
public void onButtonClick(View v) { switch (v.getId()) { case R.id.bTakePhoto: showProgress(true);/*from w w w . ja v a2 s. c o m*/ getPhoto(); break; case R.id.bFromGallery: try { showProgress(true); Intent fileChooserIntent = new Intent(); fileChooserIntent.addCategory(Intent.CATEGORY_OPENABLE); fileChooserIntent.setType("image/*"); fileChooserIntent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(fileChooserIntent, "Select Picture"), TAKE_PICTURE); } catch (Exception e) { appSettings.appendLog("main:onClick " + e.getMessage()); showProgress(false); } break; case R.id.bWebClipper: Intent iBrowse = new Intent(); iBrowse.setClassName("com.fvd.nimbus", "com.fvd.nimbus.BrowseActivity"); startActivity(iBrowse); //overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up ); overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out); break; case R.id.bPdfAnnotate: Intent ip = new Intent(); ip.setClassName("com.fvd.nimbus", "com.fvd.nimbus.ChoosePDFActivity"); startActivity(ip); //overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up ); overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out); break; case R.id.ibSettings: Intent inten = new Intent(getApplicationContext(), SettingsActivity.class); startActivityForResult(inten, SHOW_SETTINGS); //overridePendingTransition(R.anim.carbon_slide_in,R.anim.carbon_slide_out); overridePendingTransition(R.anim.carbon_slide_in, R.anim.carbon_slide_out); break; /*case R.id.bssSettings: Intent i = new Intent(getApplicationContext(), PrefsActivity.class); startActivity(i); overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up ); break; case R.id.bssRegister: Intent intent = new Intent(getApplicationContext(), RegisterDlg.class); intent.putExtra("userMail", userMail==null?"":userMail); startActivityForResult(intent, 5); overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up ); break; case R.id.bssHelp: Uri uri = Uri.parse("http://help.everhelper.me/customer/portal/articles/1376820-nimbus-clipper-for-android---quick-guide"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it); overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up ); break; case R.id.bssLogin: if(serverHelper.getInstance().getSession().length() == 0) showLogin(); else { String sessionId=""; serverHelper.getInstance().setSessionId(sessionId); appSettings.storeUserData(this, userMail, "", ""); Editor e = prefs.edit(); e.putString("userMail", userMail); e.putString("userPass", ""); e.putString("sessionId", sessionId); e.commit(); showLogin(); } break; case R.id.bssRateUs: try{ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getApplicationInfo().packageName))); } catch(Exception e){ } break;*/ } }
From source file:com.example.okano.simpleroutesearch.MapsActivity.java
/** * /*from w w w.java2s. c o m*/ // * @param from // * @param to */ // private void searchRoot(LatLng from, LatLng to){ private void searchRoot() { String fromLat = "35.681382"; String fromLng = "139.7660842"; String toLat = "35.684752"; String toLng = "139.707937"; Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); // intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity"); // intent.setClassName("com.example.okano.simpleroutesearch","com.example.okano.simpleroutesearch.MapsActivity"); intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); // String fromLat = Double.toString(from.latitude) ; // String fromLng = Double.toString(from.longitude) ; // String toLat = Double.toString(from.latitude) ; // String toLng = Double.toString(from.longitude) ; intent.setData(Uri.parse( "http://maps.google.com/maps?saddr=" + fromLat + "," + fromLng + "&daddr=" + toLat + "," + toLng)); startActivity(intent); }
From source file:com.example.linhdq.test.documents.viewing.grid.DocumentGridActivity.java
/** * Start the InstallActivity if possible and needed. *//*from w w w. j a va2 s.c om*/ private void startInstallActivityIfNeeded() { final List<OcrLanguage> installedOCRLanguages = OcrLanguageDataStore.getInstalledOCRLanguages(this); final String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED)) { if (installedOCRLanguages.isEmpty()) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName(this, InstallActivity.class.getName()); startActivityForResult(intent, REQUEST_CODE_INSTALL); } } else { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setMessage(getString(R.string.no_sd_card)); alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); alert.show(); } }
From source file:com.renard.ocr.documents.viewing.grid.DocumentGridActivity.java
/** * Start the InstallActivity if possible and needed. *//* w w w . j ava 2s . c o m*/ private void startInstallActivityIfNeeded() { final List<OcrLanguage> installedOCRLanguages = OcrLanguageDataStore.getInstalledOCRLanguages(this); final String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED)) { if (installedOCRLanguages.isEmpty()) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName(this, com.renard.ocr.install.InstallActivity.class.getName()); startActivityForResult(intent, REQUEST_CODE_INSTALL); } } else { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setMessage(getString(R.string.no_sd_card)); alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); alert.show(); } }
From source file:com.granita.tasks.TaskListActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { //custom start if (item.getItemId() == R.id.removeads) { mHelper.launchPurchaseFlow(this, ITEM_SKU, 10001, mPurchaseFinishedListener, "mypurchasetoken"); }//from ww w.jav a 2 s. com if (item.getItemId() == R.id.add_account) { Intent myIntent = new Intent(); myIntent.setClassName("com.granita.icloudcalsync", "com.granita.caldavsync.ui.setup.AddAccountActivity"); startActivity(myIntent); } //custom end if (item.getItemId() == R.id.menu_visible_list) { Intent settingsIntent = new Intent(getBaseContext(), SyncSettingsActivity.class); startActivity(settingsIntent); return true; } else if (item.getItemId() == R.id.menu_alarms) { // set and save state boolean activatedAlarms = !item.isChecked(); item.setChecked(activatedAlarms); AlarmBroadcastReceiver.setAlarmPreference(this, activatedAlarms); return true; } else { return super.onOptionsItemSelected(item); } }