I need to give some alert text message while some initilizing work is going on.
I am creating a simple app in eclipse but I am getting error at this line
b.setOnClickListener(new OnClickListener()
please have a look at the entire program
package com.example.activity2;
public class Main extends Activity {
//Called when the activity is first created.
I want to turn the android screen on button click,Now i had written a program for this in is not showing any errors also its not working..
The code for this is..
public class MainActivity extends Activity {
Button powerOff;
int amountOfTime =20*1000;
Context context = this;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(
I have a button that links to another activity, when I click on it it goes to the layout.xml I want it to
This is the java file for the main/first screen
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
addListenerOnButton();
}
public void addListenerOnButton() {
final Context context
In this activity i was trying to store data dynamically but when im pressing back button in my emulator my list items are getting deleted.....
This is my main activity...
public class Dynamic extends Activity {
Button bt,bt2;
EditText et,et2;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
I've been trying to link 2 android activities and I've coded everything however It crashes when I tried to test it on an emulator. Could you guys please help me?
I am trying to build a simple application with a button "Play" for Android.In the MainActivty.java file,I get errors with the following code,so what do I need to rectify here?
package com.example.simplemusicplayer;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
pub
My application works fine on an emulator but when i run it on tablet. I get nullpointer exception.
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