I want to install an apk file and set a broadcast-receiver in order to catch information concerning install status.
I have prepared a BroadcastReceiver class :
public class newPackageReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("DEBUG"," test for application install/uninstall");
}
}
In the main activity, I fi
I want to lock the screen of the app on button click
I have written the code as
public class MainActivity extends DeviceAdminReceiver{
public void makeTest()
{
System.out.println("Entered Main Class");
}
public class Controller extends Activity {
static final int RESULT_ENABLE = 1;
Button powerOff;
int amountOfTime =20*1000;
Context context = this;
DevicePolicyManager mDPM;
ActivityManag
It was perfectly fine to update just a TextView, but when I tried to update a ListView from onReceive, I kept getting NullPointerException from getView method (BaseAdapter). I have tried
both
handler.post & runOnUiThread but the problem remains the same.
I have two activities:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click(View view) {
Intent intent= new Intent(this, TranslucentActivity.class);
startActivity(intent);
}
}
public class TranslucentActivity extends Activity
I am trying to setup a BroadcastReceiver to handle scheduled events. I have been following http://mobile.tutsplus.com/tutorials/android/android-fundamentals-schedu... , and had the feature working, or so I believed.
Hi im very very new to android, so this would be my first app.
Im taking a java class and trying to make an app similar to a lab
we did in class.
i am writing one activity class like below
public class HeaderFooter extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.headerfooter);
}
}
and i am extending one more class from HeaderFooter class
public class Home extends HeaderFooter
{
@Override
public voi
I create an application with alarm manager and broadcast receiver and i want pass string from main activity to public class MyScheduleReceiver extends BroadcastReceiver(i have alarm manager inside) and then to public class MyStartServiceReceiver extends BroadcastReceiver for pass data to static function....In main activity save this variable from editbox with shared preferences.But i can not use s
I have a receiver that is called whenever an SMS is received
public class SMSReceiver extends BroadcastReceiver
{
private SharedPreferences prefs;
private String prefName = "MyPref";
private static final String NUMBER_KEY = "number";
@Override
public void onReceive(Context context, Intent intent)
{
//---get the SMS message passed in---
Bundle bundle = intent.getExtras();
SmsMessage