android - On Back press of second activity, 1st activity gets blank -


i have 2 activities, when go 2nd activity (2nd activity invoked 1st activity) 1st activity , 1st activity gets blank. tried call finish() after startactivity(). directly going home activity. 2nd activity contains fragment.

@override     protected void onresume() {         super.onresume();         mapview.onresume();            }     } 

if right understand question, solution can found in documentation

setup parent activity in androidmanifest.xml:

<application ... > ... <!-- main/home activity (it has no parent activity) --> <activity     android:name="com.example.myfirstapp.mainactivity" ...>     ... </activity> <!-- child of main activity --> <activity     android:name="com.example.myfirstapp.displaymessageactivity"     android:label="@string/title_activity_display_message"     android:parentactivityname="com.example.myfirstapp.mainactivity" >     <!-- parent activity meta-data support 4.0 , lower -->     <meta-data         android:name="android.support.parent_activity"         android:value="com.example.myfirstapp.mainactivity" /> </activity> 

enable go arrow in activity:

@override public void oncreate(bundle savedinstancestate) {     ...     getactionbar().setdisplayhomeasupenabled(true); } 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -