2016-10-06 2 views
1

Ich habe ein Android-Projekt für die Erstinstallation. Es ist mit meinen festen Vereinbarungsseiten verwandt. Es kommt nach Google-Vereinbarung Seiten.Wie kann ich ein erstes Installationsprojekt starten?

Ich habe ein paar Techniken dafür ausprobiert. Zum Beispiel habe ich es als Systemanwendung festgelegt. Es wird jedoch beim Sichern und Zurücksetzen bereinigt.

Weiß jemand, wie man es laufen lässt?

auf AndroidManifest.xml

<application 
     android:theme="@android:style/Theme.NoTitleBar" 
     android:allowBackup="true" 
     android:icon="@drawable/launcher" 
     android:label="@string/appname" > 
     <activity 
      android:name="xxxagreement.MainActivity" 
      android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
      android:label="@string/app_name" 
     android:screenOrientation="portrait" > 
      <intent-filter android:priority="3"> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.HOME" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
    </application> 

auf MainActivity.java

protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
    } 

@Override 
protected void onResume() { 
    Intent i = new Intent(); 
    i.setAction(AGREEGATE_STARTED); 
    sendBroadcast(i); 
    TextView t = (TextView)findViewById(R.id.textView1); 
    t.setSelected(true); 
    ... 
    super.onResume(); 
    } 

Event Log druckt:

Session 'App': Fehler beim Start von Aktivität

Antwort

0

Ihre Anwendung doesn‘ Es gibt keine Launcher-Aktivität. Ersetzen Sie diese Zeilen

<category android:name="android.intent.category.HOME" /> 
<category android:name="android.intent.category.DEFAULT" /> 

mit

<category android:name="android.intent.category.LAUNCHER" /> 
Verwandte Themen