Quantcast
Channel: Android facebook feed dialog doesn't show up - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Android facebook feed dialog doesn't show up

$
0
0

When I click on the button, the app stopped.

public class MainActivity extends ListActivity {           private  Facebook mFacebook;Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);        dialogButton.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                postToWall();            }        });        dialog.show();         } public void postToWall() {Bundle parameters = new Bundle();        parameters.putString("description", "description about link");        parameters.putString("picture","link of picture your want add with share post.");        parameters.putString("link", "Link you want to share");        parameters.putString("name","Name of link");        parameters.putString("caption","describe your caption text");            mFacebook.dialog(this, "stream.publish", parameters,new DialogListener() {                @Override                   public void onFacebookError(FacebookError arg0) {                }                public void onError(DialogError arg0) {                }                public void onComplete(Bundle arg0) {                }                public void onCancel() {                }            });         }

StackTrace:

12-14 21:26:11.198: E/AndroidRuntime(1021): FATAL EXCEPTION: main12-14 21:26:11.198: E/AndroidRuntime(1021): java.lang.NullPointerException12-14 21:26:11.198: E/AndroidRuntime(1021):     at com.example.imdb.Display.postToWall(Display.java:447)12-14 21:26:11.198: E/AndroidRuntime(1021):     at com.example.imdb.Display$1.onClick(Display.java:399)12-14 21:26:11.198: E/AndroidRuntime(1021):     at android.view.View.performClick(View.java:4202)12-14 21:26:11.198: E/AndroidRuntime(1021):     at android.view.View$PerformClick.run(View.java:17340)12-14 21:26:11.198: E/AndroidRuntime(1021):     at android.os.Handler.handleCallback(Handler.java:725)12-14 21:26:11.198: E/AndroidRuntime(1021):     at android.os.Handler.dispatchMessage(Handler.java:92)12-14 21:26:11.198: E/AndroidRuntime(1021):     at android.os.Looper.loop(Looper.java:137)12-14 21:26:11.198: E/AndroidRuntime(1021):     at android.app.ActivityThread.main(ActivityThread.java:5039)12-14 21:26:11.198: E/AndroidRuntime(1021):     at java.lang.reflect.Method.invokeNative(Native Method)12-14 21:26:11.198: E/AndroidRuntime(1021):     at java.lang.reflect.Method.invoke(Method.java:511)12-14 21:26:11.198: E/AndroidRuntime(1021):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)12-14 21:26:11.198: E/AndroidRuntime(1021):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)12-14 21:26:11.198: E/AndroidRuntime(1021):     at dalvik.system.NativeStart.main(Native Method)

Also, there is a warning says that The method dialog(Context, String, Bundle, Facebook.DialogListener) from the type Facebook is deprecated. Does this matter? How to fix this problem?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images