Intent getBundleExtra - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Intent getBundleExtra method.

This code example shows how to use the following methods:getBundleExtra, getIntExtra, getStringExtra
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		 
		Intent launchIntent = getIntent();
		final String fragclassname = launchIntent.getStringExtra(EXTRA_FRAGMENTNAME);
		final Bundle fragargs = launchIntent.getBundleExtra(EXTRA_FRAGMENTARGS);
		final int orient = launchIntent.getIntExtra(EXTRA_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
		setRequestedOrientation(orient);
		 
		try { 
			Class<?> fragmentClass = getClassLoader().loadClass(fragclassname);
			mBaseFragment = (Fragment) fragmentClass.newInstance();
			mBaseFragment.setArguments(fragargs);
			 
			FragmentTransaction tr = getSupportFragmentManager().beginTransaction();
			tr.add(android.R.id.content, mBaseFragment);
			tr.commit();
			 
		} catch(Exception e) {
8
CodeRank
This code example shows how to use the following methods:getAction, getBundleExtra, getParcelableExtra, getStringExtra
    super("InterpreterService"); 
  } 
   
  @Override 
  protected void onHandleIntent(Intent intent) {
    String action=intent.getAction();
    I_Interpreter interpreter=interpreters.get(action);  
     
    if (interpreter==null) {
      try { 
        interpreter=(I_Interpreter)Class.forName(action).newInstance();
        interpreters.put(action, interpreter);
      } 
      catch (Throwable t) {
        Log.e("InterpreterService", "Error creating interpreter", t);
      } 
    } 
     
    if (interpreter==null) {
      failure(intent, "Could not create interpreter: "+intent.getAction());

9
CodeRank
This code example shows how to use the following methods:getAction, getBundleExtra, getParcelableExtra, getStringExtra
    super("InterpreterService"); 
  } 
   
  @Override 
  protected void onHandleIntent(Intent intent) {
    String action=intent.getAction();
    I_Interpreter interpreter=interpreters.get(action);  
     
    if (interpreter==null) {
      try { 
        interpreter=(I_Interpreter)Class.forName(action).newInstance();
        interpreters.put(action, interpreter);
      } 
      catch (Throwable t) {
        Log.e("InterpreterService", "Error creating interpreter", t);
      } 
    } 
     
    if (interpreter==null) {
      failure(intent, "Could not create interpreter: "+intent.getAction());

8
CodeRank
This code example shows how to use the following methods:getBundleExtra, getStringExtra

Related Intent getBundleExtra Questions & Answers:

getBundleExtra Method Overview
Retrieve extended data from the intent.
See Code Examples for other Android Intent Methods: