My name is Ibrahim. I have been developing since I was 14. I became interested in computers & cybernetics ever since I came to this great land you call America. I have lately been developing an app on my tablet ( using Android IDE or AIDE). Lately I have been working on an app for users who their power button is either stuck or broken. It allows them to shut it off so it can reserve power while charging. After finishing today, I got this error saying "There is no applicable constructor found". I need help. Here is my MainActivity.java code:
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.view.View.*;
import android.view.*;
import android.os.PowerManager.*;
import android.content.Context.*;
import android.content.*;
import android.os.PowerManager.*;
import java.text.*;
import java.util.logging.*;
import java.lang.reflect.*;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button shutdown = (Button) findViewById(R.id.Shut_Down);
shutdown.setOnClickListener(new OnClickListener() {
PowerManager pm =new PowerManager();
@Override
public void onClick(View p1)
{
// will shut off android
}
});
}
}
And here is my main.xml page:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<Button
android:text="shutdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Shut_Down"/>
<Button
android:text="reboot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Reboot"/>
</LinearLayout>
and here is my AndroidManifest.xml code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.myapp" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>