onBootProblem in Android 4.0 -


I just completed an example of the boot but after the completion of the boot, my application may not start:

  package com.example.broadcasttest; Import android.content.BroadcastReceiver; Import android.content.Context; Import android.content.Intent; Import android.util.log; Public class Onbut Risevr expands the broadcast receiver (static final String action = "android.intent.action.BOOT_COMPLETED"; @ Override public void on Rivriv in (REFERENCES intended effect) {if (IntentkgetAction () . equivalent (action)) {intent says Haloitent = new intention (reference, the main activity. square); sayHelloIntent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity (sayHelloIntent);}}}  

The main activity is:

  package com.example.broadcasttest; Importroid.os.Bundle; Do android.support.v7.app.ActionBarActivity; Import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; public class saved the main activity ActionBarActivity extended {@ Override protected Create (bundled zero the Instansstet) {super.onCreate (SavedInstanceState); setContentView (R.layout.activity_main); TextView txt = (TextView) findViewById (R.id.textView); txt.setText ( "Hello");} @ override public boolean on CREATE OPTION MENU (menu menu) {// Extend menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fluo (R. menu menu, menu); Back true; }}  

What could be the problem? I have read somewhere that sender = tap problem can cause something like this but I'm not sure. I had the receiver permission and other employees for the Manifest hope that someone would help me? :)

Thank you ...

For clarity:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Manifest xmlns: android = "http://schemas.android.com/apk/res/android" package = "com.example.broadcasttest" Android: versionCode = "1" Android: versionName = "1.0" & gt; & Lt; Use-sdk android: minSdkVersion = "7" Android: targetSdkVersion = "18" /> & Lt; Usage-permission Android: name = "android.permission.RECEIVE_BOOT_COMPLETED" /> & Lt; Android Android: allowBackup = "true" android: icon = "@draubable / IC_Luncher" Android: label = "@ string / app_name" Android: Theme = "@ Style / Aaptim" & gt; & Lt; Activity Android: name = "com.example.broadcasttest.MainActivity" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Receiver Android: name = ". OnBootReceiver" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.BOOT_COMPLETED" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; / Application & gt; & Lt; / Reveal & gt; Anything that starts in your broadcast receiver or in that way, I can not see anything wrong in this  

Your activity on boot

I can see that only the problem is with the theme defined in your manifest (and what does).

  android: theme = "@ style / Aepthym"  

Since you're using AppCompat v7 support libraries (ie you are expanding ActionBarActivity ) You are bound to use the theme.AppCompat extended theme.

  android: theme = "@ style / theme.AppCompat"  

Without this change, I expect you to get an error in your logs at startup. I am indicating the problem with the activity topic.


Comments