Ich bin mit der Anwendung von Eclipse und es wird zweimal gestartet werden: zum ersten Mal die App startet, dann wieder nach wenigen Sekunden der NeubelebungWie zu vermeiden, zweimal die Applikation für Android starten, Rennen von Eclipse realen Gerät
Meine app Splash Screen --- >> Hauptaktivität (Beide werden zweimal geöffnet).
Ich habe bereits versucht, Android: launchMode = "singleInstance" in meine Manifest-Datei, aber nicht erfolgreich.
i 3 verschiedene Anwendungen von meinem Eclipse versucht habe, noch zweimal in meinem Kitkat öffnen, Lutscher reales Gerät (erstellt neues Projekt, das man auch zweimal zu öffnen)
EDIT 1:
Versuchten Hinzufügen Diese Zeile in Manifest-Datei, aber nicht Erfolg- android: launchMode = "singleTop"
lassen Sie mich bitte wissen, wie Sie dieses Problem lösen.
Manifest-Datei:
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:largeHeap="true"
android:launchMode="singleInstance"
android:theme="@style/AppTheme2" >
<activity
android:name=".Start"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Mein Start Activity.java
public class Start extends Activity
{
SessionManagerFor_Signin session;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Session class instance
session = new SessionManagerFor_Signin(getApplicationContext());
// Remove the Title Bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.start);
ImageView Image1=(ImageView)findViewById(R.id.imageView1);
//Animation Bottom to Top
TranslateAnimation animation2 = new TranslateAnimation(0.0f, 0.0f,400.0f, 0.0f);
animation2.setDuration(1000);
animation2.setFillAfter(false);
Image1.startAnimation(animation2);
Thread timer = new Thread()
{
@Override
public void run()
{
try {
sleep(3000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
finally
{
session.checkLogin();
finish();
}
}
};
timer.start();
//For Full Action bar Color Starts
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setTranslucentStatus(true);
}
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintResource(R.color.FUllStartColor);
//For Full Action bar Color Ends here
}
@TargetApi(19)
private void setTranslucentStatus(boolean on) {
Window win = getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
if (on) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
}
win.setAttributes(winParams);
}
Ich habe 3 verschiedene Anwendungen aus meiner Eclipse versucht noch zweimal in meinem realen Gerät Kitkat, Lollipop (auch erstellt neues Projekt, das man auch zweimal öffnen) – Kumar
Haben Sie eine Lösung? Ich habe auch dasselbe Problem. Bitte helfen Sie mir, dieses Problem zu lösen. –