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
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
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?
My application works fine on an emulator but when i run it on tablet. I get nullpointer exception.
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 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
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.
Friends I just Wanna set Custom Typeface Form my assets/fonts folder
My Java Code Looks like this
package customtext;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
public class Custom extends Dialog implements android.view.View.OnClickListener{
public Custom(Co