Monday, April 22, 2013

[android help] Changing content provider package after refactor


I forked the IOSchedule app from last year's Google IO. I want to make sure I can get an API key which means I need to sign the application and it doesn't have conflicts with the content provider which means I need to refactor. However every time I try to use the Android Tools > Refactor Package Name, I get issues, namely with modifying a content provider.


This is the tag for the content provider:



android:name="com.google.android.apps.iosched.provider.ScheduleProvider"
android:authorities="com.google.android.apps.iosched"
android:label="@string/app_name"
android:syncable="true"
android:writePermission="com.google.android.apps.iosched.permission.WRITE_SCHEDULE" />


I've been trying to change it to the following:



android:name="com.google.android.apps.iosched.provider.ScheduleProvider"
android:authorities="org.mrkaiser.android.apps.iosched"
android:label="@string/app_name"
android:syncable="true"
android:writePermission="com.google.android.apps.iosched.permission.WRITE_SCHEDULE" />


However at runtime I get the following error:


04-22 21:29:13.818: E/AndroidRuntime(12329): java.lang.NullPointerException 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.google.android.apps.iosched.ui.MyScheduleFragment.onLoadFinished(MyScheduleFragment.java:175) 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.google.android.apps.iosched.ui.MyScheduleFragment.onLoadFinished(MyScheduleFragment.java:1) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:424) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:392) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.Loader.deliverResult(Loader.java:103) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:81) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:35) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.AsyncTaskLoader.dispatchOnLoadComplete(AsyncTaskLoader.java:221) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.AsyncTaskLoader$LoadTask.onPostExecute(AsyncTaskLoader.java:61) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.ModernAsyncTask.finish(ModernAsyncTask.java:461) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.ModernAsyncTask.access$500(ModernAsyncTask.java:47) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.ModernAsyncTask$InternalHandler.handleMessage(ModernAsyncTask.java:474) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.os.Handler.dispatchMessage(Handler.java:99) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.os.Looper.loop(Looper.java:137) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.app.ActivityThread.main(ActivityThread.java:5226) 04-22 21:29:13.818: E/AndroidRuntime(12329): at java.lang.reflect.Method.invokeNative(Native Method) 04-22 21:29:13.818: E/AndroidRuntime(12329): at java.lang.reflect.Method.invoke(Method.java:511) 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562) 04-22 21:29:13.818: E/AndroidRuntime(12329): at dalvik.system.NativeStart.main(Native Method)


I'm not sure what I'm doing wrong. If I try and refactor the packages R gets out of sync along with some xml files and I can't recover.



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...