Can anyone explain how to shut down android phone using PowerManager?
Code:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
pm.goToSleep(SystemClock.uptimeMillis());
and added these permissions in the manifest file
Code:
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
<uses-permission android:name="android.permission.DEVICE_POWER"/>
<uses-permission android:name="android.permission.REBOOT"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
The app has got root permissions and I have my own keystore to sign the app!
Code:
04-03 17:58:08.735: E/AndroidRuntime(8435): FATAL EXCEPTION: main
04-03 17:58:08.735: E/AndroidRuntime(8435): java.lang.SecurityException: Neither user 10165 nor current process has android.permission.DEVICE_POWER.
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Parcel.readException(Parcel.java:1425)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Parcel.readException(Parcel.java:1379)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.IPowerManager$Stub$Proxy.goToSleep(IPowerManager.java:375)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.PowerManager.goToSleep(PowerManager.java:481)
04-03 17:58:08.735: E/AndroidRuntime(8435): at com.schogini.fridayproject.MainActivity$1.onClick(MainActivity.java:50)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.view.View.performClick(View.java:4204)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.view.View$PerformClick.run(View.java:17355)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Handler.handleCallback(Handler.java:725)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Handler.dispatchMessage(Handler.java:92)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Looper.loop(Looper.java:137)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.app.ActivityThread.main(ActivityThread.java:5234)
04-03 17:58:08.735: E/AndroidRuntime(8435): at java.lang.reflect.Method.invokeNative(Native Method)
04-03 17:58:08.735: E/AndroidRuntime(8435): at java.lang.reflect.Method.invoke(Method.java:525)
04-03 17:58:08.735: E/AndroidRuntime(8435): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
04-03 17:58:08.735: E/AndroidRuntime(8435): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
04-03 17:58:08.735: E/AndroidRuntime(8435): at dalvik.system.NativeStart.main(Native Method)
I'm some what struck here. Can someone please help me to workout this.
Just because you put device power permissions in manifest doesn't mean you /your app have that privileges..
At boot/when installing your app ~package manager on purpose, ignores that permission.protection level 4. Check boot log.
I think the only possible way is to make it a system app and the app should be signed with the same platform keys that are used to sign Android system,settings etc.
Even then, I don't know whether it'll work /not. Good luck
LâTêS†↭ⓛⓘⓝⓚⓢ™CM10 HTC A310E.
If I haven't given you link, it's above. Just click it
njarun said:
Can anyone explain how to shut down android phone using PowerManager?
Code:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
pm.goToSleep(SystemClock.uptimeMillis());
and added these permissions in the manifest file
Code:
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
<uses-permission android:name="android.permission.DEVICE_POWER"/>
<uses-permission android:name="android.permission.REBOOT"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
The app has got root permissions and I have my own keystore to sign the app!
Code:
04-03 17:58:08.735: E/AndroidRuntime(8435): FATAL EXCEPTION: main
04-03 17:58:08.735: E/AndroidRuntime(8435): java.lang.SecurityException: Neither user 10165 nor current process has android.permission.DEVICE_POWER.
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Parcel.readException(Parcel.java:1425)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Parcel.readException(Parcel.java:1379)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.IPowerManager$Stub$Proxy.goToSleep(IPowerManager.java:375)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.PowerManager.goToSleep(PowerManager.java:481)
04-03 17:58:08.735: E/AndroidRuntime(8435): at com.schogini.fridayproject.MainActivity$1.onClick(MainActivity.java:50)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.view.View.performClick(View.java:4204)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.view.View$PerformClick.run(View.java:17355)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Handler.handleCallback(Handler.java:725)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Handler.dispatchMessage(Handler.java:92)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.os.Looper.loop(Looper.java:137)
04-03 17:58:08.735: E/AndroidRuntime(8435): at android.app.ActivityThread.main(ActivityThread.java:5234)
04-03 17:58:08.735: E/AndroidRuntime(8435): at java.lang.reflect.Method.invokeNative(Native Method)
04-03 17:58:08.735: E/AndroidRuntime(8435): at java.lang.reflect.Method.invoke(Method.java:525)
04-03 17:58:08.735: E/AndroidRuntime(8435): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
04-03 17:58:08.735: E/AndroidRuntime(8435): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
04-03 17:58:08.735: E/AndroidRuntime(8435): at dalvik.system.NativeStart.main(Native Method)
I'm some what struck here. Can someone please help me to workout this.
Click to expand...
Click to collapse
Hi did you accomplish making your power managment app?
whare to get one?
I know this is an ancient thread, but for the sake of anyone who stumbles onto it from google, there *is* a way to fake your way through this that works up to at least Android 7.0:
First off, that function is no longer public (its hidden), so the only way to gain access to it is by reflection using something like this;
Code:
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
try {
pm.getClass().getMethod("goToSleep", new Class[]{long.class}).invoke(pm, SystemClock.uptimeMillis());
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e){
e.printStackTrace();
}
Second, you need the permission... android.permission.DEVICE_POWER.
BUT... this is where you will run in to problems, because asking for it in the AndroidManifest.xml is NOT going to work. In fact, it doesn't help you at all to put it there because it will flat out refuse you.
So how to accomplish that?
Well... the magic file.
/data/system/packages.xml
1) Install your package into /system/priv-app/YourPackageName/YourPackageName.apk
2) Reboot
3) edit the file /data/system/packages.xml:
location the section corresponding to your package.
Add your permission inside the <perms></perms> block. If the block doesn't exist, add it;
Code:
<perms>
<item name="android.permission.DEVICE_POWER" granted="true" flags="0" />
</perms>
Think you're done yet? Nope. If you reboot now, you will find a message in your logcat indicating that it is *removing* the permission. That is not what you want.
So to fix that problem, you need to also adjust a couple of other items in the package's listing (same file);
1) <cert index="2">
2) <proper-signing-keyset identifier="1" />
I'm not sure if those values are constant, or if they vary from device to device. Copy them from the package "com.android.settings".
Save, quit, sync, reboot, THERE YOU GO!
Related
hey guys it's been like 2 days no when i try to unlock my phone the screen freezes..
sometimes i get this?
java.lang.SecurityException: Permission Denial: opening provider com.google.android.gm.provider.MailProvider from ProcessRecord{407c6ed8 1761:com.sec.android.app.twlauncher/10032} (pid=1761, uid=10032) requires com.google.android.gm.permission.READ_GMAIL or com.google.android.gm.permission.WRITE_GMAIL
at android.os.Parcel.readException(Parcel.java:1322)
at android.os.Parcel.readException(Parcel.java:1276)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:1882)
at android.app.ActivityThread.getProvider(ActivityThread.java:3351)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:3376)
at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:1826)
at android.content.ContentResolver.acquireProvider(ContentResolver.java:748)
at android.content.ContentResolver.query(ContentResolver.java:256)
at com.sec.android.app.twlauncher.Launcher.onGmailChanged(Launcher.java:30)
at com.sec.android.app.twlauncher.GmailObserver.onChange(GmailObserver.java:23)
at android.database.ContentObserver$NotificationRunnable.run(ContentObserver.java:43)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
I have webservice setup http://168.187.121.70/WSJAWW/service.asmx
How can I call it?
I want to call it on buton click sendmessage
public void sendMessage(View view) {
// Do something in response to button
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
I have done this
Code:
package com.example.myfirstapp;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity {
public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
private static final String SOAP_ACTION = "http://tempuri.org/GetAlbums";
private static final String METHOD_NAME = "GetAlbums";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "http://168.187.121.70/WSJAWW/service.asmx";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return super.onCreateOptionsMenu(menu);
}
public void sendMessage(View view) {
// Do something in response to button
/* Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);*/
try
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("ArtistId", "-1");
request.addProperty("StartId", "1");
request.addProperty("CatId", "1");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
Object result = (Object)envelope.getResponse();
Toast.makeText(this, result.toString(), Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
public boolean onOptionsItemSelected(MenuItem item) {
// Handle presses on the action bar items
switch (item.getItemId()) {
case R.id.action_search:
// openSearch();
return true;
case R.id.action_settings:
// openSettings();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
Click to expand...
Click to collapse
I get socket failed :EACCES (Permission denied)
krikor1 said:
I have done this
I get socket failed :EACCES (Permission denied)
Click to expand...
Click to collapse
I think you need to include <uses-permission android:name="android.permission.INTERNET"/> in your app's manifest file.
ndp_singe said:
I think you need to include <uses-permission android:name="android.permission.INTERNET"/> in your app's manifest file.
Click to expand...
Click to collapse
yes that did it, however when i debug i get stuck at [2013-09-19 18:38:02 - MYFirstApp] Attempting to connect debugger to 'com.example.myfirstapp' on port 8600
I wanna debug, coz i dont see anything i am doing system.out.println
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("ArtistId", "-1");
request.addProperty("StartId", "1");
request.addProperty("CatId", "1");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
System.out.println("krirkrirk");
Object result = (Object)envelope.getResponse();
Toast.makeText(this, result.toString(), Toast.LENGTH_LONG).show();
somewhere here its crashing imo
it crashes at androidHttpTransport.call(SOAP_ACTION, envelope);
dunno why.any help?
krikor1 said:
yes that did it, however when i debug i get stuck at [2013-09-19 18:38:02 - MYFirstApp] Attempting to connect debugger to 'com.example.myfirstapp' on port 8600
I wanna debug, coz i dont see anything i am doing system.out.println
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("ArtistId", "-1");
request.addProperty("StartId", "1");
request.addProperty("CatId", "1");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
System.out.println("krirkrirk");
Object result = (Object)envelope.getResponse();
Toast.makeText(this, result.toString(), Toast.LENGTH_LONG).show();
somewhere here its crashing imo
Click to expand...
Click to collapse
I think you cannot do System.out.println() on Android.
Use Log.d("myTag", "myMessage") instead.
nikwen said:
I think you cannot do System.out.println() on Android.
Use Log.d("myTag", "myMessage") instead.
Click to expand...
Click to collapse
I do that, i get my first app has to be stopped
Code:
09-19 18:47:05.798: E/AndroidRuntime(29848): FATAL EXCEPTION: main
09-19 18:47:05.798: E/AndroidRuntime(29848): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View$1.onClick(View.java:3633)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View.performClick(View.java:4240)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.os.Looper.loop(Looper.java:137)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:05.798: E/AndroidRuntime(29848): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:47:05.798: E/AndroidRuntime(29848): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:47:05.798: E/AndroidRuntime(29848): at dalvik.system.NativeStart.main(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View$1.onClick(View.java:3628)
09-19 18:47:05.798: E/AndroidRuntime(29848): ... 11 more
09-19 18:47:05.798: E/AndroidRuntime(29848): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.util.Log.println_native(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.util.Log.d(Log.java:138)
09-19 18:47:05.798: E/AndroidRuntime(29848): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:47:05.798: E/AndroidRuntime(29848): ... 14 more
09-19 18:47:30.955: E/AndroidRuntime(30168): FATAL EXCEPTION: main
09-19 18:47:30.955: E/AndroidRuntime(30168): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View$1.onClick(View.java:3633)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View.performClick(View.java:4240)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.os.Looper.loop(Looper.java:137)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:30.955: E/AndroidRuntime(30168): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:47:30.955: E/AndroidRuntime(30168): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:47:30.955: E/AndroidRuntime(30168): at dalvik.system.NativeStart.main(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View$1.onClick(View.java:3628)
09-19 18:47:30.955: E/AndroidRuntime(30168): ... 11 more
09-19 18:47:30.955: E/AndroidRuntime(30168): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.util.Log.println_native(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.util.Log.d(Log.java:138)
09-19 18:47:30.955: E/AndroidRuntime(30168): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:47:30.955: E/AndroidRuntime(30168): ... 14 more
09-19 18:49:17.259: E/AndroidRuntime(30750): FATAL EXCEPTION: main
09-19 18:49:17.259: E/AndroidRuntime(30750): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View$1.onClick(View.java:3633)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View.performClick(View.java:4240)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.os.Looper.loop(Looper.java:137)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:49:17.259: E/AndroidRuntime(30750): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:49:17.259: E/AndroidRuntime(30750): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:49:17.259: E/AndroidRuntime(30750): at dalvik.system.NativeStart.main(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View$1.onClick(View.java:3628)
09-19 18:49:17.259: E/AndroidRuntime(30750): ... 11 more
09-19 18:49:17.259: E/AndroidRuntime(30750): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.util.Log.println_native(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.util.Log.e(Log.java:231)
09-19 18:49:17.259: E/AndroidRuntime(30750): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:49:17.259: E/AndroidRuntime(30750): ... 14 more
09-19 18:50:39.907: E/AndroidRuntime(31052): FATAL EXCEPTION: main
09-19 18:50:39.907: E/AndroidRuntime(31052): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View$1.onClick(View.java:3633)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View.performClick(View.java:4240)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.os.Looper.loop(Looper.java:137)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:50:39.907: E/AndroidRuntime(31052): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:50:39.907: E/AndroidRuntime(31052): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:50:39.907: E/AndroidRuntime(31052): at dalvik.system.NativeStart.main(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View$1.onClick(View.java:3628)
09-19 18:50:39.907: E/AndroidRuntime(31052): ... 11 more
09-19 18:50:39.907: E/AndroidRuntime(31052): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.util.Log.println_native(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.util.Log.println(Log.java:332)
09-19 18:50:39.907: E/AndroidRuntime(31052): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:50:39.907: E/AndroidRuntime(31052): ... 14 more
09-19 18:51:10.640: E/AndroidRuntime(31288): FATAL EXCEPTION: main
09-19 18:51:10.640: E/AndroidRuntime(31288): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View$1.onClick(View.java:3633)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View.performClick(View.java:4240)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.os.Looper.loop(Looper.java:137)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:51:10.640: E/AndroidRuntime(31288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:51:10.640: E/AndroidRuntime(31288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:51:10.640: E/AndroidRuntime(31288): at dalvik.system.NativeStart.main(Native Method)
09-19 18:51:10.640: E/AndroidRuntime(31288): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View$1.onClick(View.java:3628)
09-19 18:51:10.640: E/AndroidRuntime(31288): ... 11 more
09-19 18:51:10.640: E/AndroidRuntime(31288): Caused by: java.lang.NullPointerException
09-19 18:51:10.640: E/AndroidRuntime(31288): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:51:10.640: E/AndroidRuntime(31288): ... 14 more
09-19 18:54:51.165: E/AndroidRuntime(31543): FATAL EXCEPTION: main
09-19 18:54:51.165: E/AndroidRuntime(31543): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View$1.onClick(View.java:3633)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View.performClick(View.java:4240)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.os.Looper.loop(Looper.java:137)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:54:51.165: E/AndroidRuntime(31543): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:54:51.165: E/AndroidRuntime(31543): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:54:51.165: E/AndroidRuntime(31543): at dalvik.system.NativeStart.main(Native Method)
09-19 18:54:51.165: E/AndroidRuntime(31543): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View$1.onClick(View.java:3628)
09-19 18:54:51.165: E/AndroidRuntime(31543): ... 11 more
09-19 18:54:51.165: E/AndroidRuntime(31543): Caused by: java.lang.NullPointerException
09-19 18:54:51.165: E/AndroidRuntime(31543): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:54:51.165: E/AndroidRuntime(31543): ... 14 more
this is error i get in my logcat.
when I call androidHttpTransport.call(SOAP_ACTION, envelope);
I get exception null, and i enter catch statement. why? any help?
krikor1 said:
I do that, i get my first app has to be stopped
Code:
09-19 18:47:05.798: E/AndroidRuntime(29848): FATAL EXCEPTION: main
09-19 18:47:05.798: E/AndroidRuntime(29848): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View$1.onClick(View.java:3633)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View.performClick(View.java:4240)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.os.Looper.loop(Looper.java:137)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:05.798: E/AndroidRuntime(29848): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:47:05.798: E/AndroidRuntime(29848): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:47:05.798: E/AndroidRuntime(29848): at dalvik.system.NativeStart.main(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.view.View$1.onClick(View.java:3628)
09-19 18:47:05.798: E/AndroidRuntime(29848): ... 11 more
09-19 18:47:05.798: E/AndroidRuntime(29848): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.util.Log.println_native(Native Method)
09-19 18:47:05.798: E/AndroidRuntime(29848): at android.util.Log.d(Log.java:138)
09-19 18:47:05.798: E/AndroidRuntime(29848): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:47:05.798: E/AndroidRuntime(29848): ... 14 more
09-19 18:47:30.955: E/AndroidRuntime(30168): FATAL EXCEPTION: main
09-19 18:47:30.955: E/AndroidRuntime(30168): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View$1.onClick(View.java:3633)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View.performClick(View.java:4240)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.os.Looper.loop(Looper.java:137)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:30.955: E/AndroidRuntime(30168): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:47:30.955: E/AndroidRuntime(30168): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:47:30.955: E/AndroidRuntime(30168): at dalvik.system.NativeStart.main(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.view.View$1.onClick(View.java:3628)
09-19 18:47:30.955: E/AndroidRuntime(30168): ... 11 more
09-19 18:47:30.955: E/AndroidRuntime(30168): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.util.Log.println_native(Native Method)
09-19 18:47:30.955: E/AndroidRuntime(30168): at android.util.Log.d(Log.java:138)
09-19 18:47:30.955: E/AndroidRuntime(30168): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:47:30.955: E/AndroidRuntime(30168): ... 14 more
09-19 18:49:17.259: E/AndroidRuntime(30750): FATAL EXCEPTION: main
09-19 18:49:17.259: E/AndroidRuntime(30750): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View$1.onClick(View.java:3633)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View.performClick(View.java:4240)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.os.Looper.loop(Looper.java:137)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:49:17.259: E/AndroidRuntime(30750): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:49:17.259: E/AndroidRuntime(30750): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:49:17.259: E/AndroidRuntime(30750): at dalvik.system.NativeStart.main(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.view.View$1.onClick(View.java:3628)
09-19 18:49:17.259: E/AndroidRuntime(30750): ... 11 more
09-19 18:49:17.259: E/AndroidRuntime(30750): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.util.Log.println_native(Native Method)
09-19 18:49:17.259: E/AndroidRuntime(30750): at android.util.Log.e(Log.java:231)
09-19 18:49:17.259: E/AndroidRuntime(30750): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:49:17.259: E/AndroidRuntime(30750): ... 14 more
09-19 18:50:39.907: E/AndroidRuntime(31052): FATAL EXCEPTION: main
09-19 18:50:39.907: E/AndroidRuntime(31052): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View$1.onClick(View.java:3633)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View.performClick(View.java:4240)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.os.Looper.loop(Looper.java:137)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:50:39.907: E/AndroidRuntime(31052): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:50:39.907: E/AndroidRuntime(31052): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:50:39.907: E/AndroidRuntime(31052): at dalvik.system.NativeStart.main(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.view.View$1.onClick(View.java:3628)
09-19 18:50:39.907: E/AndroidRuntime(31052): ... 11 more
09-19 18:50:39.907: E/AndroidRuntime(31052): Caused by: java.lang.NullPointerException: println needs a message
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.util.Log.println_native(Native Method)
09-19 18:50:39.907: E/AndroidRuntime(31052): at android.util.Log.println(Log.java:332)
09-19 18:50:39.907: E/AndroidRuntime(31052): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:50:39.907: E/AndroidRuntime(31052): ... 14 more
09-19 18:51:10.640: E/AndroidRuntime(31288): FATAL EXCEPTION: main
09-19 18:51:10.640: E/AndroidRuntime(31288): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View$1.onClick(View.java:3633)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View.performClick(View.java:4240)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.os.Looper.loop(Looper.java:137)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:51:10.640: E/AndroidRuntime(31288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:51:10.640: E/AndroidRuntime(31288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:51:10.640: E/AndroidRuntime(31288): at dalvik.system.NativeStart.main(Native Method)
09-19 18:51:10.640: E/AndroidRuntime(31288): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:51:10.640: E/AndroidRuntime(31288): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:51:10.640: E/AndroidRuntime(31288): at android.view.View$1.onClick(View.java:3628)
09-19 18:51:10.640: E/AndroidRuntime(31288): ... 11 more
09-19 18:51:10.640: E/AndroidRuntime(31288): Caused by: java.lang.NullPointerException
09-19 18:51:10.640: E/AndroidRuntime(31288): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:51:10.640: E/AndroidRuntime(31288): ... 14 more
09-19 18:54:51.165: E/AndroidRuntime(31543): FATAL EXCEPTION: main
09-19 18:54:51.165: E/AndroidRuntime(31543): java.lang.IllegalStateException: Could not execute method of the activity
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View$1.onClick(View.java:3633)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View.performClick(View.java:4240)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View$PerformClick.run(View.java:17721)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.os.Handler.handleCallback(Handler.java:730)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.os.Handler.dispatchMessage(Handler.java:92)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.os.Looper.loop(Looper.java:137)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:54:51.165: E/AndroidRuntime(31543): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-19 18:54:51.165: E/AndroidRuntime(31543): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 18:54:51.165: E/AndroidRuntime(31543): at dalvik.system.NativeStart.main(Native Method)
09-19 18:54:51.165: E/AndroidRuntime(31543): Caused by: java.lang.reflect.InvocationTargetException
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 18:54:51.165: E/AndroidRuntime(31543): at java.lang.reflect.Method.invoke(Method.java:525)
09-19 18:54:51.165: E/AndroidRuntime(31543): at android.view.View$1.onClick(View.java:3628)
09-19 18:54:51.165: E/AndroidRuntime(31543): ... 11 more
09-19 18:54:51.165: E/AndroidRuntime(31543): Caused by: java.lang.NullPointerException
09-19 18:54:51.165: E/AndroidRuntime(31543): at com.example.myfirstapp.MainActivity.sendMessage(MainActivity.java:82)
09-19 18:54:51.165: E/AndroidRuntime(31543): ... 14 more
this is error i get in my logcat.
Click to expand...
Click to collapse
According to the logcat, you didn't enter a message.
---------- Post added at 06:09 PM ---------- Previous post was at 06:09 PM ----------
krikor1 said:
when I call androidHttpTransport.call(SOAP_ACTION, envelope);
I get exception null, and i enter catch statement. why? any help?
Click to expand...
Click to collapse
This might help you finding the reason for the NPE: http://forum.xda-developers.com/showthread.php?t=2325164
xposed log is eating all the space available.
Code:
java.lang.NoSuchFieldError: com.android.systemui.statusbar.policy.ClockCenter#mExpandedHeader
at de.robv.android.xposed.XposedHelpers.findField(XposedHelpers.java:69)
at de.robv.android.xposed.XposedHelpers.getBooleanField(XposedHelpers.java:628)
at ma.wanam.xposed.XSysUIStatusBarClockPackage$1.afterHookedMethod(Unknown Source)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:645)
at com.android.systemui.statusbar.policy.Clock.updateClock(Native Method)
at com.android.systemui.statusbar.policy.Clock$2$1.run(Clock.java:362)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
can any body know how to fix this?
bump
toinktoink said:
xposed log is eating all the space available.
Code:
java.lang.NoSuchFieldError: com.android.systemui.statusbar.policy.ClockCenter#mExpandedHeader
at de.robv.android.xposed.XposedHelpers.findField(XposedHelpers.java:69)
at de.robv.android.xposed.XposedHelpers.getBooleanField(XposedHelpers.java:628)
at ma.wanam.xposed.XSysUIStatusBarClockPackage$1.afterHookedMethod(Unknown Source)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:645)
at com.android.systemui.statusbar.policy.Clock.updateClock(Native Method)
at com.android.systemui.statusbar.policy.Clock$2$1.run(Clock.java:362)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
can any body know how to fix this?
Click to expand...
Click to collapse
Can you upload your SystemUI.apk on my main thread?
Hey guys,
I'm having a problem figuring out a way to store the geofences that my app creates, in order to load them when I run the app again. The purpose is to show a list of geofences created by the user.
I tried to serialize them using Java's Serialization and I also tried to use Gson to convert them into a Json string. The problem with Gson it's when I try to load them, it gives me an error message saying that Geofence is not a class. (which is true, it's an interface).
logcat:
Code:
09-09 21:37:16.148 18137-18137/? D/dalvikvm﹕ Late-enabling CheckJNI
09-09 21:37:17.515 18137-18137/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
09-09 21:37:17.515 18137-18137/? W/dalvikvm﹕ VFY: unable to resolve virtual method 614: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
09-09 21:37:17.515 18137-18137/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
09-09 21:37:17.515 18137-18137/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
09-09 21:37:17.515 18137-18137/? W/dalvikvm﹕ VFY: unable to resolve virtual method 636: Landroid/content/res/TypedArray;.getType (I)I
09-09 21:37:17.515 18137-18137/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
09-09 21:37:18.133 18137-18137/? D/GoogleAPIMsg﹕ Construcao do Client Google
09-09 21:37:18.164 18137-18137/? D/Manager﹕ Loading Geofences...
09-09 21:37:18.203 18137-18137/? D/AndroidRuntime﹕ Shutting down VM
09-09 21:37:18.203 18137-18137/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x419307c0)
09-09 21:37:18.234 18137-18137/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smartlocation.wilcocsjrxxlxpto/com.smartlocation.wilcocsjrxxlxpto.HomeScreen}: java.lang.RuntimeException: Unable to invoke no-args constructor for interface com.google.android.gms.location.Geofence. Register an InstanceCreator with Gson for this type may fix this problem.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2339)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5289)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Unable to invoke no-args constructor for interface com.google.android.gms.location.Geofence. Register an InstanceCreator with Gson for this type may fix this problem.
at com.google.gson.internal.ConstructorConstructor$12.construct(ConstructorConstructor.java:210)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:186)
at com.google.gson.Gson.fromJson(Gson.java:810)
at com.google.gson.Gson.fromJson(Gson.java:775)
at com.google.gson.Gson.fromJson(Gson.java:724)
at com.google.gson.Gson.fromJson(Gson.java:696)
at com.smartlocation.wilcocsjrxxlxpto.core.Manager.loadGeofences(Manager.java:203)
at com.smartlocation.wilcocsjrxxlxpto.HomeScreen.load(HomeScreen.java:252)
at com.smartlocation.wilcocsjrxxlxpto.HomeScreen.onCreate(HomeScreen.java:66)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2293)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
************at android.app.ActivityThread.access$600(ActivityThread.java:153)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
************at android.os.Handler.dispatchMessage(Handler.java:99)
************at android.os.Looper.loop(Looper.java:137)
************at android.app.ActivityThread.main(ActivityThread.java:5289)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:525)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
************at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:48)
at com.google.gson.internal.ConstructorConstructor$12.construct(ConstructorConstructor.java:207)
************at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:186)
************at com.google.gson.Gson.fromJson(Gson.java:810)
************at com.google.gson.Gson.fromJson(Gson.java:775)
************at com.google.gson.Gson.fromJson(Gson.java:724)
************at com.google.gson.Gson.fromJson(Gson.java:696)
************at com.smartlocation.wilcocsjrxxlxpto.core.Manager.loadGeofences(Manager.java:203)
************at com.smartlocation.wilcocsjrxxlxpto.HomeScreen.load(HomeScreen.java:252)
************at com.smartlocation.wilcocsjrxxlxpto.HomeScreen.onCreate(HomeScreen.java:66)
************at android.app.Activity.performCreate(Activity.java:5133)
************at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
************at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2293)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
************at android.app.ActivityThread.access$600(ActivityThread.java:153)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
************at android.os.Handler.dispatchMessage(Handler.java:99)
************at android.os.Looper.loop(Looper.java:137)
************at android.app.ActivityThread.main(ActivityThread.java:5289)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:525)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
************at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.InstantiationException: can't instantiate class com.google.android.gms.location.Geofence; abstract class or interface
at sun.misc.Unsafe.allocateInstance(Native Method)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:525)
************at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:48)
************at com.google.gson.internal.ConstructorConstructor$12.construct(ConstructorConstructor.java:207)
************at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:186)
************at com.google.gson.Gson.fromJson(Gson.java:810)
************at com.google.gson.Gson.fromJson(Gson.java:775)
************at com.google.gson.Gson.fromJson(Gson.java:724)
************at com.google.gson.Gson.fromJson(Gson.java:696)
************at com.smartlocation.wilcocsjrxxlxpto.core.Manager.loadGeofences(Manager.java:203)
************at com.smartlocation.wilcocsjrxxlxpto.HomeScreen.load(HomeScreen.java:252)
************at com.smartlocation.wilcocsjrxxlxpto.HomeScreen.onCreate(HomeScreen.java:66)
************at android.app.Activity.performCreate(Activity.java:5133)
************at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
************at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2293)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
************at android.app.ActivityThread.access$600(ActivityThread.java:153)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
************at android.os.Handler.dispatchMessage(Handler.java:99)
************at android.os.Looper.loop(Looper.java:137)
************at android.app.ActivityThread.main(ActivityThread.java:5289)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:525)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
************at dalvik.system.NativeStart.main(Native Method)
09-09 21:37:18.648 18137-18137/? I/Process﹕ Sending signal. PID: 18137 SIG: 9
code:
Code:
public class Manager implements ResultCallback<Status>, LocationListener {
// Tag para fazer debug
protected static final String MAN = "Manager";
protected static final String SMS = "eventSMS";
protected static final String RING = "eventRing";
private Context mAppContext;
private GoogleApiClient mGoogleApiClient;
private LocationRequest mLocationRequest;
// Listas de Geofences
private TreeMap<String, Geofence> mGeofences;
private TreeMap<String, Event> mEvents;
private int mCounterActiveGeofences;
private PendingIntent mGeofencePendingIntent;
private Intent updateLocIntent;
/* Save */
private Gson gson;
private SharedPreferences prefs;
public Manager(Context context, GoogleApiClient googleApiClient){
mGeofences = new TreeMap<String, Geofence>();
mEvents = new TreeMap<String, Event>();
mGeofencePendingIntent = null;
mAppContext = context;
mGoogleApiClient = googleApiClient;
mCounterActiveGeofences = 0;
prefs = context.getSharedPreferences(Constants.Geofences, Context.MODE_PRIVATE);
gson = new Gson();
}
...
public void saveGeofences(){
String json;
Geofence geofence;
SharedPreferences.Editor editor = prefs.edit();
Log.d(MAN, "Saving Geofences...");
for (Map.Entry<String, Geofence> entry : mGeofences.entrySet()) {
geofence = mGeofences.get(entry.getKey());
json = gson.toJson(geofence);
editor.putString(geofence.getRequestId(), json);
Log.d(MAN, geofence.getRequestId() + " json: " + json);
}
editor.apply();
}
public void loadGeofences(){
Map<String, ?> keys = prefs.getAll();
Log.d(MAN, "Loading Geofences...");
for (Map.Entry<String, ?> entry : keys.entrySet()) {
String jsonString = prefs.getString(entry.getKey(), null);
Geofence geofence = gson.fromJson(jsonString, Geofence.class);
Log.d(MAN, geofence.getRequestId());
mGeofences.put(geofence.getRequestId(), geofence);
}
}
}
Thank you in advance.
wilcocsjr said:
Hey guys,
I'm having a problem figuring out a way to store the geofences that my app creates, in order to load them when I run the app again. The purpose is to show a list of geofences created by the user.
I tried to serialize them using Java's Serialization and I also tried to use Gson to convert them into a Json string. The problem with Gson it's when I try to load them, it gives me an error message saying that Geofence is not a class. (which is true, it's an interface).
Thank you in advance.
Click to expand...
Click to collapse
Could you show your code and show logcat read sticky thread how to post development questions
Sent from my SM-G530H using XDA Free mobile app
AndroidFire said:
Could you show your code and show logcat read sticky thread how to post development questions
Sent from my SM-G530H using XDA Free mobile app
Click to expand...
Click to collapse
Just edited the original post, sorry about that
Whenever I long-press the power-button or try to switch to another user, the System-UI completely crashes.
My device is rooted with magisk 13 (beta) and has Substratum installed.
Deactivation of Substratum does not help, and uninstalling Magisk leaves the device unbootable (have to reinstall TWRP and restore a backup then).
Code:
07-06 10:40:02.911 E/AndroidRuntime( 1394): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.ui
07-06 10:40:02.911 E/AndroidRuntime( 1394): android.content.res.Resources$NotFoundException: File res/layout/zzz_op_global_actions_view_port.xml from xml type layout resource ID #0x5030004
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:990)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2103)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.content.res.Resources.getLayout(Resources.java:1115)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.view.LayoutInflater.inflate(LayoutInflater.java:424)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.OpGlobalActions.initView(OpGlobalActions.java:258)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.OpGlobalActions.show(OpGlobalActions.java:181)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.OpGlobalActions.showDialog(OpGlobalActions.java:172)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.PhoneWindowManager.showGlobalActionsInternal(PhoneWindowManager.java:1569)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.PhoneWindowManager.powerLongPress(PhoneWindowManager.java:1414)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.PhoneWindowManager.-wrap15(PhoneWindowManager.java)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.policy.PhoneWindowManager$PolicyHandler.handleMessage(PhoneWindowManager.java:896)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.os.Handler.dispatchMessage(Handler.java:102)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.os.Looper.loop(Looper.java:154)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.os.HandlerThread.run(HandlerThread.java:61)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at com.android.server.ServiceThread.run(ServiceThread.java:46)
07-06 10:40:02.911 E/AndroidRuntime( 1394): Caused by: java.io.FileNotFoundException: res/layout/zzz_op_global_actions_view_port.xml
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.content.res.AssetManager.openXmlAssetNative(Native Method)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:542)
07-06 10:40:02.911 E/AndroidRuntime( 1394): at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:975)
07-06 10:40:02.911 E/AndroidRuntime( 1394): ... 15 more
Any idea, how to fix this?
Thanks in advance!
do you have black notifications?
For dark notifications, android and systemui both overlays must be installed. skipping one of them will give you unreadable notifications
Android overlay causes softboot when power button is pressed (instead of showing power menu). This is not a theme bug and happens on all ROMS without OMS. If you cant live with this, dont use dark notifs and dont install android overlay
tadessi said:
do you have black notifications?
Click to expand...
Click to collapse
No, I have the standard theme and notifications show in light colour.
Had installed Rounded UI theme in substratum, but the problem persists, when all overlays are deactivated.
kr_ke said:
No, I have the standard theme and notifications show in light colour.
Had installed Rounded UI theme in substratum, but the problem persists, when all overlays are deactivated.
Click to expand...
Click to collapse
I suggest you the below
First reboot to TWRP and flash the legacy zip
/sdcard/substratum/SubstratumRescue_Legacy.zip
Reboot and check
If it still doesn't work dirty flash the complete 4.5.5 zip which will overwrite your system ui and your problem should be fixed.
Sent from my OnePlus5 using XDA Labs
Meanwhile the problem seems to be solved.
Cause the last OTA caused the device to stuck in boot process, I tapped on 'forget my password' on the OnePlus-Recovery. This really cleaned up everything.
But be carefull: I don't know if the internal storage gets wiped too.
After this I flashed TWRP and Magisk and everything works again.