After successful login and post to facebook from android application on next day i got error
<p>I created a small application which logs in to Facebook and then I can post the text on wall. It worked well at first. But the next day, the application gets Facebook onerror.</p>

<pre><code>public class fblogin extends Activity implements OnClickListener {

    String API_ID;
    Facebook fb;
    TextView fronttext;
    ImageView pic;
    Button postbutton,loginfb; 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loginscreen);

        API_ID = getString(R.string.API_ID);
        fb= new Facebook(API_ID);
        pic=(ImageView) findViewById(R.id.picture_pic);
        fronttext=(TextView)findViewById(R.id.fronttext);
        postbutton= (Button)findViewById(R.id.post);
        loginfb=(Button)findViewById(R.id.login);

        loginfb.setOnClickListener(this);
        updateButtonImage();
    }

    public void updateButtonImage()
    {
        if(fb.isSessionValid())
        {   
            postbutton.setVisibility(Button.VISIBLE);
            loginfb.setText("Logout");
            fronttext.setText("WelCome ");
            pic.setVisibility(ImageView.VISIBLE);
            Toast.makeText(getApplicationContext(), "You are log In ",Toast.LENGTH_LONG);


            JSONObject obj=null;
            URL img_url=null;

            try {
                String jsonUser = fb.request("me");
                obj=Util.parseJson(jsonUser);
                String id = obj.optString("id");
                String name=obj.optString("name");
                fronttext.setText("WelCome "+ name);
                img_url =new URL("http://graph.facebook.com/"+id+"/picture?type=small");
                Bitmap bmp=BitmapFactory.decodeStream(img_url.openConnection().getInputStream()); 
                pic.setImageBitmap(bmp);

            } catch (FacebookError e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (MalformedURLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }



        }
        else
        {
            postbutton.setVisibility(Button.INVISIBLE);
            loginfb.setText("Login");
            fronttext.setText("To get Started , Login Using Facebook");
            pic.setVisibility(ImageView.INVISIBLE);
            Toast.makeText(getApplicationContext(), "You are log Out ",Toast.LENGTH_LONG);
        }

    }

    public void postbuttonClicks(View v)
    {
        switch(v.getId()){
        case R.id.post:
            //post
            fb.dialog(fblogin.this,"feed",new DialogListener() {

                @Override
                public void onFacebookError(FacebookError e) {
                    // TODO Auto-generated method stub
                    Toast.makeText(fblogin.this, "facebook Error....", Toast.LENGTH_LONG).show();
                }

                @Override
                public void onError(DialogError e) {
                    // TODO Auto-generated method stub
                    Toast.makeText(fblogin.this, "Error On Page.....", Toast.LENGTH_LONG).show();
                }

                @Override
                public void onComplete(Bundle values) {
                    Toast.makeText(fblogin.this, "Sucessfully Post on wall...", Toast.LENGTH_LONG).show();

                }

                @Override
                public void onCancel() {
                    Toast.makeText(fblogin.this, "Cancel The Activity....", Toast.LENGTH_LONG).show();

                }
            });

            break;

        }


    }
    @Override
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        if(fb.isSessionValid()){
            //log out

        try {
            fb.logout(getApplicationContext());
            updateButtonImage();
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        }

        else{
            //login
               fb.authorize(fblogin.this,new DialogListener() {

                   @Override
                    public void onComplete(Bundle values) {

                        updateButtonImage();
                    }
                   @Override
                public void onFacebookError(FacebookError e) {
                       updateButtonImage();
                    Toast.makeText(fblogin.this, "facebookError", Toast.LENGTH_LONG).show();
                }

                @Override
                public void onError(DialogError e) {

                    Toast.makeText(fblogin.this, "facebookon...Error", Toast.LENGTH_LONG).show();
                }



                @Override
                public void onCancel() {
                    // TODO Auto-generated method stub
                    Toast.makeText(fblogin.this, "facebookCancel", Toast.LENGTH_LONG).show();
                }
            });

        }
    }  
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        super.onActivityResult(requestCode, resultCode, data);
         fb.authorizeCallback(requestCode, resultCode, data);

    }
}
</code></pre>

<p>Then I created <code>onActivityResult</code> method and error gets resolved and I can login. But today once again I got that error. What do I do to solve it? Is there a problem in my program? Or a session problem?</p>
