0

I am making an android app. the first launcher activity code is :

 package com.example.test;   
    import android.app.Activity;
    import android.content.Intent;
    import android.content.SharedPreferences;
    import android.os.Bundle;
    public class FirstPage extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        SharedPreferences sp = getSharedPreferences("STATE",0);
        String x = sp.getString("typeOfUser","");

       if(x==""){
            setContentView(R.layout.activity_first_page);
            Intent intent = new Intent(this,LoginOrRegister.class);
           startActivity(intent);
      }
        else {
            setContentView(R.layout.lat_lon);
        }

    }
}

Manifest file is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />
    <uses-permission android:maxSdkVersion="19" android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.test.FirstPage"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".LoginOrRegister" />
        <activity android:name="Registration"></activity>
        <activity android:name="SignIn"></activity>
    </application>

</manifest>

But when running this app. there is error: :

No command output when running: 'am start -n com.example.test/com.example.test.FirstPage -a android.intent.action.MAIN -c android.intent.category.LAUNCHER' on device emulator-5554

this is my stack trace:

 com.android.ddmlib.ShellCommandUnresponsiveException
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:430)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:347)
    at com.android.ddmlib.Device.executeShellCommand(Device.java:584)
    at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:67)
    at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:109)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doLaunchAction(AndroidLaunchController.java:1293)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doLaunchAction(AndroidLaunchController.java:1305)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchApp(AndroidLaunchController.java:1277)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.simpleLaunch(AndroidLaunchController.java:913)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.continueLaunch(AndroidLaunchController.java:755)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:575)
    at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(LaunchConfigDelegate.java:330)
    at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:246)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
sagar
  • 725
  • 2
  • 13
  • 30
  • 1
    I have issues like this all the time. The install works but the shell fails to launch the app. Just open up your App on the device like any other. Also, you should use "".equals(x) instead of x=="" – Spidy Apr 04 '14 at 17:41

1 Answers1

0

Could be a duplicate of one of these questions, which have to do with the same ShellCommandUnresponsiveException exception shown in the stack trace:

Community
  • 1
  • 1
cybersam
  • 63,203
  • 6
  • 53
  • 76