Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid:startActivityForResult( ) is not calling
    primarykey
    data
    text
    <p>I have one application in that when I click on settings button, I need to move to another activity which contains tabs. I build up all the code and it is working well for Acer tab. When I run the same application in Samsung Galaxy(4.1.1) It is showing "Unfortunately,app has stopped" error. Check my code below:</p> <pre><code>settingsBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent prefIntent = new Intent(v.getContext(), Preferences.class); startActivityForResult(prefIntent, 0); } }); </code></pre> <p>//Preferences.java</p> <pre><code> setContentView(R.layout.preferences); private Button pref_close; pref_close = (Button) findViewById(R.id.close_prefs); TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("wifi").setIndicator("Wifi Settings",null).setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new Intent(this, AppSettings.class); spec = tabHost.newTabSpec("settings").setIndicator(" Clock Settings",null).setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); pref_close.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //finish(); setResult(RESULT_OK); } }); </code></pre> <p>The issue is here when I comment the startActivityForResult() then my app is not force closing and preferences.java file is not calling. In my logcat show any errors, but showing as</p> <pre><code>03-28 11:30:37.734: E/AndroidRuntime(4668): java.lang.RuntimeException: Unable to resume activity {com.vision.clock/com.vision.clock.activity.Preferences}: java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.wifi.WifiPickerActivity}: java.lang.SecurityException: Given caller package com.android.settings is not running in process ProcessRecord </code></pre> <p>I'm not getting solution to find out the issue.. Can anybody find out the solution.</p> <p>Thanks in advance...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload