Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just <strong>removed the FLAG and it's all working</strong> for me,There is no any problem..First Activity Remain Transparent and getting on top when called..Just Try.</p> <p>Here the code of my whole example,</p> <p><strong>FirstAct</strong></p> <pre><code>public class FirstAct extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button btn = new Button(this); btn.setText("First Here Go To Second"); btn.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(FirstAct.this,SecondAct.class); startActivity(intent); } }); setContentView(btn); } } </code></pre> <p><strong>SecondAct</strong></p> <pre><code>public class SecondAct extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button btn = new Button(this); btn.setText("Second Here Go To Third"); btn.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(SecondAct.this,ThirdAct.class); startActivity(intent); } }); setContentView(btn); } } </code></pre> <p><strong>ThirdAct</strong></p> <pre><code>public class ThirdAct extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button btn = new Button(this); btn.setText("Third Here Go To First"); btn.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(ThirdAct.this,FirstAct.class); //intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); } }); setContentView(btn); } } </code></pre> <p><strong>Edit Activity with LaunchMode SingleInsance</strong> *<em>Manifest</em>*</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mj.temp" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="8" /&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".FirstAct" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:launchMode="singleInstance" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="SecondAct" android:launchMode="singleInstance"&gt;&lt;/activity&gt; &lt;activity android:name="ThirdAct" android:launchMode="singleInstance"&gt;&lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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