hi,

the idea of moving the content provider on to some common library
seems quite reasonable.
but i have a doubt whether all the content providers (like
contacts,etc..) are implemented in the same way..
and moreover we do import them in our applications right?
can somebody shed some light on these please..




On Mar 11, 9:53 pm, Makas Tzavellas <makas.tzavel...@gmail.com> wrote:
> The error stack trace indicates that you are using
> com.mypack.android.mycontentprovider.MyProvider class directly in
> com.mypack.android.appwidgetsettingstest.TestActivity where I assume
> your second application is located.
>
> You *cannot* import classes or reference classes that does not belong
> to your application classpath. If you are trying to reference some
> public static fields. It would be better that you separate them into a
> common library that can be shared by both your content provider
> application and your "other" applications. As both applications run in
> their own VM, hence they have their own classloaders.
>
> You will need to use intents and ContentResolver to communicate with
> your ContentProvider. It is not possible to reference the content
> provider implementation directly.
>
> On Mar 9, 8:28 pm, Musafir <musafir4frie...@gmail.com> wrote:
>
> > hi friends,
> > i created a custom content provider in one android application
> > following all guidelines from developers.android.com and an activity
> > in same application with an edittext and a button.when ever i enter
> > any integer value and click on the button ,using custom content
> > provider am inserting value to a sqlite database...this worked fine.
> > but when i created another application and tried to access the custom
> > content provider by importing custom provider class am getting the
> > following exception:
>
> > W/dalvikvm(  418): VFY: unable to resolve static field 29
> > (CONTENT_URI) in Lcom/
> > mypack/android/mycontentprovider/MyProvider;
> > W/dalvikvm(  418): VFY:  rejecting opcode 0x62 at 0x0047
> > W/dalvikvm(  418): VFY:  rejected Lcom/mypack/android/
> > appwidgetsettingstest/Test
> > Activity;.onCreate (Landroid/os/Bundle;)V
> > W/dalvikvm(  418): Verifier rejected class Lcom/mypack/android/
> > appwidgetsettings
> > test/TestActivity;
> > W/dalvikvm(  418): Class init failed in newInstance call (Lcom/mypack/
> > android/ap
> > pwidgetsettingstest/TestActivity;)
> > D/AndroidRuntime(  418): Shutting down VM
> > W/dalvikvm(  418): threadid=3: thread exiting with uncaught exception
> > (group=0x4
> > 001aa28)
> > E/AndroidRuntime(  418): Uncaught handler: thread main exiting due to
> > uncaught e
> > xception
> > E/AndroidRuntime(  418): java.lang.VerifyError:
> > com.mypack.android.appwidgetsett
> > ingstest.TestActivity
> > E/AndroidRuntime(  418):        at
> > java.lang.Class.newInstanceImpl(Native Method
> > )
> > E/AndroidRuntime(  418):        at
> > java.lang.Class.newInstance(Class.java:1472)
> > E/AndroidRuntime(  418):        at
> > android.app.Instrumentation.newActivity(Instr
> > umentation.java:1097)
> > E/AndroidRuntime(  418):        at
> > android.app.ActivityThread.performLaunchActiv
> > ity(ActivityThread.java:2316)
> > E/AndroidRuntime(  418):        at
> > android.app.ActivityThread.handleLaunchActivi
> > ty(ActivityThread.java:2417)
> > E/AndroidRuntime(  418):        at android.app.ActivityThread.access
> > $2100(Activi
> > tyThread.java:116)
> > E/AndroidRuntime(  418):        at android.app.ActivityThread
> > $H.handleMessage(Ac
> > tivityThread.java:1794)
> > E/AndroidRuntime(  418):        at
> > android.os.Handler.dispatchMessage(Handler.ja
> > va:99)
> > E/AndroidRuntime(  418):        at android.os.Looper.loop(Looper.java:
> > 123)
> > E/AndroidRuntime(  418):        at
> > android.app.ActivityThread.main(ActivityThrea
> > d.java:4203)
> > E/AndroidRuntime(  418):        at
> > java.lang.reflect.Method.invokeNative(Native
> > Method)
> > E/AndroidRuntime(  418):        at
> > java.lang.reflect.Method.invoke(Method.java:5
> > 21)
> > E/AndroidRuntime(  418):        at com.android.internal.os.ZygoteInit
> > $MethodAndA
> > rgsCaller.run(ZygoteInit.java:791)
> > E/AndroidRuntime(  418):        at
> > com.android.internal.os.ZygoteInit.main(Zygot
> > eInit.java:549)
> > E/AndroidRuntime(  418):        at
> > dalvik.system.NativeStart.main(Native Method)
>
> > Help me plz ..Thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to