Discussion Forums  >  Uncategorized

Replies: 2    Views: 259

SirSean
Lost but trying
Profile
Posts: 6
Reg: Sep 08, 2011
Germantown, TN
560
02/02/12 01:22 PM (14 years ago)

Unable to Add Socialize to CustomURL

Hi, I am trying to add the Socialize Action Bar to my Android app. I have followed the Getting Started guide with success until I get to step 5: Include Socialize in your App! (http://socialize.github.com/socialize-sdk-android/getting_started.html#include-socialize-in-your-app). I have pasted the Action Bar code into the Bt_screen_customURL.java file with no success. This is a snippet of what my current code looks like: import com.socialize.Socialize; import com.socialize.api.SocializeSession; import com.socialize.auth.AuthProviderType; import com.socialize.error.SocializeException; import com.socialize.listener.SocializeAuthListener; import com.socialize.ui.SocializeUI; import com.socialize.entity.Entity;; public class BT_screen_customURL extends BT_activity_base{ protected static final String Tag = null; private boolean didCreate = false; private WebView webView = null; private String dataURL = ; private String currentURL = ; private String originalURL = ; private AlertDialog confirmLaunchInNativeAppDialogue = null; private AlertDialog confirmEmailDocumentDialogue = null; private String showBrowserBarBack = ; private String showBrowserBarLaunchInNativeApp = ; private String showBrowserBarEmailDocument = ; private String showBrowserBarRefresh = ; ////////////////////////////////////////////////////////////////////////// //activity life-cycle events. //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); this.activityName = BT_screen_customURL; BT_debugger.showIt(activityName + :onCreate); Socialize.init(this); // Your entity key. May be passed as a Bundle parameter to your activity String entityKey = http://www.tftw.org; // Create an entity object including a name // The Entity object is Serializable, so you could also store the whole object in the Intent Entity entity = Entity.newInstance(entityKey, Socialize); // Wrap your existing view with the action bar. // your_layout refers to the resource ID of your current layout. View actionBarWrapped = Socialize.getSocializeUI().showActionBar(this, R.layout.screen_customurl, entity); // Now set the view for your activity to be the wrapped view. setContentView(actionBarWrapped); This is what my LogCat is showing: 02-02 06:32:50.152: W/ZZ(1972): BT_act_controller:loadScreenObject for screen with nickname google and type BT_screen_customURL 02-02 06:32:50.152: W/ZZ(1972): BT_act_controller:canLoadDocumentInWebView http://www.google.com 02-02 06:32:50.523: W/ZZ(1972): BT_screen_customURL:onCreate 02-02 06:32:51.372: W/Socialize(1972): ContainerBuilder: No bean found with name [authProviders]. May not have been created yet 02-02 06:32:51.372: W/Socialize(1972): ContainerBuilder: No bean found with name [sessionFactory]. May not have been created yet 02-02 06:32:51.962: D/dalvikvm(1972): GC_FOR_MALLOC freed 24015 objects / 1530560 bytes in 92ms 02-02 06:32:53.112: D/dalvikvm(1972): GC_FOR_MALLOC freed 33136 objects / 1922376 bytes in 120ms 02-02 06:32:53.217: D/AndroidRuntime(1972): Shutting down VM 02-02 06:32:53.217: W/dalvikvm(1972): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 02-02 06:32:53.332: E/AndroidRuntime(1972): FATAL EXCEPTION: main 02-02 06:32:53.332: E/AndroidRuntime(1972): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.truthfortheworld/com.truthfortheworld.BT_screen_customURL}: java.lang.NullPointerException 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.os.Handler.dispatchMessage(Handler.java:99) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.os.Looper.loop(Looper.java:123) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.ActivityThread.main(ActivityThread.java:4627) 02-02 06:32:53.332: E/AndroidRuntime(1972): at java.lang.reflect.Method.invokeNative(Native Method) 02-02 06:32:53.332: E/AndroidRuntime(1972): at java.lang.reflect.Method.invoke(Method.java:521) 02-02 06:32:53.332: E/AndroidRuntime(1972): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 02-02 06:32:53.332: E/AndroidRuntime(1972): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 02-02 06:32:53.332: E/AndroidRuntime(1972): at dalvik.system.NativeStart.main(Native Method) 02-02 06:32:53.332: E/AndroidRuntime(1972): Caused by: java.lang.NullPointerException 02-02 06:32:53.332: E/AndroidRuntime(1972): at com.truthfortheworld.BT_screen_customURL.onCreate(BT_screen_customURL.java:167) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-02 06:32:53.332: E/AndroidRuntime(1972): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 02-02 06:32:53.332: E/AndroidRuntime(1972): ... 11 more 02-02 06:32:59.181: I/Process(1972): Sending signal. PID: 1972 SIG: 9 In the emulator, when I start the customURL screen, I get the message Sorry! The application.... (process com......) has stopped unexpectedly. Please try again. I am new to this, so if there is any more information needed to analyze the issue, please ask. Thanks a million for your help!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/23/12 04:27 PM (13 years ago)
.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/23/12 04:27 PM (13 years ago)
.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.