Facebook Dialog is not appeared when click on Facebook button in android -


i facing problem in integration of facebook in android app. have tried ways unfortunately not getting results want. tried 1) facebook login button. 2)custom button facebook integration.

when try implement facebook login button , click on button facebook dialog not appeared , main screen.... here code .

loginbutton authbutton = (loginbutton) findviewbyid(r.id.authbutton);           authbutton.setonerrorlistener(new onerrorlistener() {             @override            public void onerror(facebookexception error) {             log.i(tag, "error " + error.getmessage());            }           });           // set permission list, don't foeget add email           authbutton.setreadpermissions(arrays.aslist("basic_info","email"));           // session state call event           authbutton.setsessionstatuscallback(new session.statuscallback() {             @override            public void call(session session, sessionstate state, exception exception) {              if (session.isopened()) {                       log.i(tag,"access token"+ session.getaccesstoken());                       request.executemerequestasync(session,                               new request.graphusercallback() {                                   @override                                   public void oncompleted(graphuser user,response response) {                                       if (user != null) {                                         log.i(tag,"user id "+ user.getid());                                        log.i(tag,"email "+ user.asmap().get("email")); //                                     lblemail.settext(user.asmap().get("email").tostring());                                        toast.maketext(getapplicationcontext(), "email", toast.length_long).show();                                       }                                   }                               });                   }             }           }); 

2) , when try custom button. gives error unable understand. code is

button more = (button) findviewbyid(r.id.button1); more.setonclicklistener(new view.onclicklistener() {     public void onclick(view view) {          if (! facebook.issessionvalid()) {                       facebook.authorize(homeactivity.this, permissions, new logindialoglistener());          });     } 

and when implementing logindialoglistener();

private class logindialoglistener implements dialoglistener {      public void oncomplete(bundle values) {         savecredentials(facebook);         getalbumsdata task = new getalbumsdata();                    task.execute();     }      public void onfacebookerror(facebookerror error) {         showtoast("authentication facebook failed!");     }      public void onerror(dialogerror error) {         showtoast("authentication facebook failed!");     }      public void oncancel() {         showtoast("authentication facebook cancelled!");     } } 

and here xml

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/relativelayout1"     android:layout_width="match_parent"     android:layout_height="match_parent"      tools:context=".mainactivity" xmlns:app="http://schemas.android.com/apk/res-auto">     <relativelayout          android:layout_height="wrap_content"         android:layout_width="fill_parent"         android:layout_alignparenttop="true"         android:background="@color/blue"         >           <button              android:id="@+id/menu"             android:layout_alignparentleft="true"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_marginleft="10dp"             android:background="@drawable/ic_launcher"             />          <edittext             android:id="@+id/search"             android:layout_width="60dp"             android:layout_height="wrap_content"             android:layout_alignparentright="true"             android:layout_alignparenttop="true"             android:layout_marginright="78dp"             android:background="@drawable/ic_launcher"             android:ems="10" />      </relativelayout>      <scrollview         android:id="@+id/scrollview"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:layout_alignparentleft="true"         android:layout_alignparenttop="true"         android:layout_marginleft="24dp" >          <tablelayout             android:id="@+id/tablelayout1"             android:layout_width="256dp"             android:layout_height="match_parent"             android:layout_margintop="50dp" >              <textview                 android:id="@+id/textview3"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="10dp"                 android:text="social sign in"                 android:textappearance="?android:attr/textappearancelarge" />              <tablerow                 android:id="@+id/fbrow"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content" >                  <button                     android:id="@+id/signin_fbbtn"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_marginleft="10dp"                     android:layout_margintop="20dp"                     android:text="facebook" />             </tablerow>             <com.facebook.widget.loginbutton          android:id="@+id/authbutton"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_alignparenttop="true"          android:layout_centerhorizontal="true"          android:layout_margintop="45dp" />               <textview                 android:id="@+id/textview4"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="10dp"                 android:layout_margintop="20dp"                 android:text="sign in"                 android:textappearance="?android:attr/textappearancelarge" />              <tablerow                 android:id="@+id/tablerow1"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_margintop="20dp" >                  <textview                     android:id="@+id/textview1"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_marginleft="10dp"                     android:text="email" />                  <edittext                     android:id="@+id/edittext1"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_marginleft="20dp"                     android:layout_marginright="10dp"                     android:ems="10"                     android:hint="abc@gmail.com"                     android:inputtype="textemailaddress" >                      <requestfocus />                 </edittext>             </tablerow>              <tablerow                 android:id="@+id/tablerow2"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_margintop="20dp" >                  <textview                     android:id="@+id/textview2"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_marginleft="10dp"                     android:text="password" />                  <edittext                     android:id="@+id/edittext2"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_marginleft="20dp"                     android:ems="10"                     android:hint="*******"                     android:inputtype="textpassword" >                      <requestfocus />                 </edittext>             </tablerow>              <tablerow                 android:id="@+id/tablerow3"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="100dp" >                  <button                     android:id="@+id/button1"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margintop="30dp"                     android:text="login" />              </tablerow>                 <textview                 android:id="@+id/signup_textview"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="20dp"                 android:layout_margintop="20dp"                 android:text="not registered? sign up!" />              <imageview                 android:id="@+id/imageview1"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:src="@drawable/g_line" />              <textview                 android:id="@+id/textview6"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="20dp"                 android:layout_margintop="20dp"                 android:text="u connect 2013!" />          </tablelayout>     </scrollview>  </relativelayout> 

what "permissions" means ?? getalbumsdata means?? getting error on both of these... kindly me ...

thanks in advance....


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -