Search Results

Search found 2 results on 1 pages for 'metalex'.

Page 1/1 | 1 

  • android service onBind SecurityException

    - by Metalex
    I don't know why but in some devices my service isn't allowed to bind. java.lang.RuntimeException: Unable to create application mypackage.MyApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41680e78 (pid=16805) when binding service Intent { cmp=mypackage/.MyService } at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41680e78 (pid=16805) when binding service Intent { cmp=mypackage/.MyService } at android.os.Parcel.readException(Parcel.java:1425) at android.os.Parcel.readException(Parcel.java:1379) at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:2720) at android.app.ContextImpl.bindService(ContextImpl.java:1431) at android.app.ContextImpl.bindService(ContextImpl.java:1407) at android.content.ContextWrapper.bindService(ContextWrapper.java:473) at mypackage.MyApplication.openService(MyApplication.java:151) at mypackage.MyApplication.onCreate(MyApplication.java:110) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391) ... 10 more java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41680e78 (pid=16805) when binding service Intent { cmp=mypackage/.MyService } at android.os.Parcel.readException(Parcel.java:1425) at android.os.Parcel.readException(Parcel.java:1379) at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:2720) at android.app.ContextImpl.bindService(ContextImpl.java:1431) at android.app.ContextImpl.bindService(ContextImpl.java:1407) at android.content.ContextWrapper.bindService(ContextWrapper.java:473) at mypackage.MyApplication.openService(MyApplication.java:151) at mypackage.MyApplication.onCreate(MyApplication.java:110) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Code from MyApplication: @Override public void onCreate() { super.onCreate(); openService(); } public void openService() { Intent service = new Intent(this, MyService.class); mConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { mService = IMyService.Stub.asInterface(service); if (mListener != null) { mListener.onServiceStarted(mService); } } @Override public void onServiceDisconnected(ComponentName cn) { mService = null; } }; bindService(service, mConnection, Context.BIND_AUTO_CREATE); // 151 line } Please help me! Thank you!

    Read the article

  • imageview weights in linearlayout

    - by Metalex
    I have this layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:minWidth="100dp" > <TextView android:id="@+id/txt_what_way" android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="4" android:textAppearance="?android:attr/textAppearanceMedium" /> <LinearLayout android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="3"> <ImageView android:layout_width="20dp" android:layout_height="20dp" android:scaleType="fitCenter" android:src="@drawable/ic_launcher"/> </LinearLayout> <LinearLayout android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight="3"> <ImageView android:layout_width="20dp" android:layout_height="20dp" android:scaleType="fitCenter" android:src="@drawable/ic_launcher"/> </LinearLayout> </LinearLayout> I want that it looks like: TextView - 40% of width, Layout with ImageView - 30% of widht, Layout with ImageView - 30% of width. But the output is: TextViewImageViewImageView----------------free space---------------------------------- Thanks for your help! -- EDITED Done it in programmatic way

    Read the article

1