boot - Why app not launching on booting android device? -


I'm testing the following app on HTC with Android 2.3.5. For some reasons the app is not starting to restart or boot the phone.

I should know that I am absolutely wrong?

BootReciever.java

  Import android.os.Bundle; Import android App Import android.content.BroadcastReceiver; Import android.content.Context; Import android.content.Intent; Import android.view.Menu; Import android.widget.Toast; Public class BootupReceiver Broadcast receiver spreads (referred to in public disorder (reference reference, intent to intent) {Toast. Make text (context, "app start", toast. LNNHT_LOG) Show (); / * Intent startActivityIntent = new intent ( Context, mainActivity.class); startActivityIntent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity (startActivityIntent); * / // context.startActivity (new intent (reference, MainActivity.class));}}   

MainActivity.java

  import android.os.bundle; import android.app import android.content.Context; Import android.view.Menu; Import android.content.BroadcastReceiver; Import android.widget.Toast; Import android.content.Intent; Public Classroom increases main activity activity {@ Override Creates Protected Zero (Bundle Saved InstantState) ) {Super.onCreate (savedInstanceState); setContentView (R.layout.activity_main);}}   

Android manifest file:

 < Code> & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Manifest xmlns: Android = "http://schemas.android.com/apk/res/android" package = "com.example.androidbootreciever" Android: versionCode = "1" android: versionName = "1.0" & gt; & Lt; Use-sdk android: minSdkVersion = "8" Android: targetSdkVersion = "17" /> & 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.hello_android_world.MainActivity" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Receiver Android: name = "com.example.androidbootreciever.BootupReceiver" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.BOOT_COMPLETED" /> & Lt; Action Android: name = "android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;   

This code is working on restarting, but after turning it off, turn on the phone. Here are the messages that I get in my locket:

Enter image details here

Have you expanded BootupReceiver with Activity? This broadcast should be extended with the receiver.

  Public Class BootupReceiver Expands Broadcast Receiver {}    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -