Re: [android-developers] start at boot app gives instantiationException:

2012-02-20 Thread TreKing
You have the following:

public abstract class StartAtBootActivity extends *BroadcastReceiver*{



 *activity *android:name=.StartAtBootActivity


See the problem with this scenario?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] start at boot app gives instantiationException:

2012-02-19 Thread Thomas
Hello All,

I assembled  the logic below which is supposed to start at boot and
launch the Hello World program.  What I get is an error 02-19
23:09:04.517: E/AndroidRuntime(3975): java.lang.RuntimeException:
Unable to instantiate activity ComponentInfo{com.needham.startatboot/
com.needham.startatboot.StartAtBootActivity}:
java.lang.InstantiationException:
com.needham.startatboot.StartAtBootActivity 


Any help appreciated
Best,
Tom B
--- program  
package com.needham.startatboot;

import android.app.Activity;
import android.os.Bundle;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public abstract class StartAtBootActivity extends BroadcastReceiver{

 @Override
 public void onReceive(Context context, Intent intent) {
PackageManager pm = context.getPackageManager();
Intent appStartIntent =
pm.getLaunchIntentForPackage(com.needham.helloworld);
 if (null != appStartIntent)
 {
context.startActivity(appStartIntent);
 }
 }
}

 Android Manifest ---
?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.needham.startatboot
android:versionCode=1
android:versionName=1.0 

uses-sdk android:minSdkVersion=9 /
uses-permission android:name
=android.permission.RECEIVE_BOOT_COMPLETED /

application
android:icon=@drawable/ic_launcher
android:label=@string/app_name 
activity
android:name=.StartAtBootActivity
android:label=@string/app_name 
intent-filter
action android:name=android.intent.action.MAIN /

category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
receiver android:enabled=true android:name=.startatboot
android:permission=android.permission.RECEIVE_BOOT_COMPLETED

intent-filter
   action android:name=android.intent.action.BOOT_COMPLETED 
/
   category android:name=android.intent.category.DEFAULT /
/intent-filter
 /receiver

/application

/manifest

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en