If I press the back button from my main activity I get a black screen. Is this normal behavior ? To get round this I have put in the following code – is this an ok work around ?
public void onBackPressed() {
return;
}
EDIT
Here is the manifest in case it is wrong :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.example.DatabaseImport"
android:versionCode="1"
android:versionName="1.0"
android:screenOrientation="portrait">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DetailView"
android:label="@string/detail_label"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
</activity>
</application>
</manifest>
It’s not a normal behavious.
Do you have an initial activity from which you start your “main” activity?
Do you have any key listeners?
It sounds like you have another activity calling your “main” activity and clicking back in the “main” activity goes back to the unfinished initial activity.
EDIT:
From your edit I see you don’t have an additional activity before the main one, so the only assumption is that you’re doing something wrong in onStop / onPause or onDestroy. Please paste these.