java - Can't change text of TextView Android -


Welcome text view can not change I need help.

I'm editing to show all the codes again ...

    package.application.listaslist; Import android.support.v7.app.ActionBarActivity; Import android.support.v7.app.ActionBar; Import android.support.v4.app.Fragment; Importroid.os.Bundle; Import android.view.LayoutInflater; Import android.view.Menu; Import android.view.MenuItem; Import android.view.View; Import android.view.ViewGroup; Import android App Import android.content.Intent; Import android.widget.TextView; Import com.facebook. *; Import com.facebook.model. *; Public Class Main Activity ActionBarActivity Extensively Created on {@ Override Protected Zero (Bundle Saved Instantstate) {Super.New (Saved Instantstate); SetContentView (R.layout.activity_main); If (saved instenstat == empty) {getSupportFragmentManager () StartTransaction () Add (RID Container, New Placeholder Fragment ()). Commit (); } // Start Facebook Login session. Open Active Sessions (This is true, new session status callback () {// callback When the session changes, the government overrides zero calls (session session, location of session, exception exception) (if (session .isOpened) (//) to request me / request me an API. NEEMEEEEEEst (session, new request. GraphUserCallback () {// Override the public spaces in the callback after graph API response with user object (graph)User user, feedback response) {if (user! = Tap) {TextView welcome = (TextView) findViewById (R.id.welcome); welcome.setText ("Hello" + user.getName () + "!");} }}) ExecuteAsync ();}}}); } @ Override public empty on activative result (intrate codecod, int result code, intent data) {if (session.getactivation ()! = Null) {session.getactivation (). On activative result (this, requestcode, resultcode, data); } Super.onActivityResult (requestCode, ResultsCode, Data); } @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Enhancing Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fulao (R. menu menu, menu); Back true; } @ Override Public Boolean On Option Itam Select (menu item) {// Handle action bar item here clicks the action bar will automatically handle clicks on the home / up button automatically, so long as / when You specify a parental activity in AndroidManifest.xml. Int id = item.getItemId (); If (id == R.id.action_settings) {TextView welcome = (TextView) findViewById (R.id.welcome); Welcome.setText ("ConfiguraçÃμes"); } Return Super.Options item selected (item); } / ** * A placeholder piece containing a simple view. * / Public static class placeholder Fregment (public placeholder fragment) () {} @ See override public Crete View (Leautifltr Inflatr, View Group container, bundle saved Instensstet) {See Rutwu = Inflaiar Inflat (r. Leteft. Framentment_man, container, Falls); Return root view; }}}}  

You must execute your request with executeAsync (). Otherwise it will not be executed:

  session.panactive session (this is true, new session status callback (// callback) When the session changes, override the government zero call (Session session, location of session, exception exception) {if (session.isOpened ()) I request for API request. Newmemrequest (session, new request. GraphUserCallback () {@Override on public zero End (GraphUser user, feedback response) {if (user! = Null) {TextView Wagt = (TextView) findViewById (R.id.welcome); welcome.setText ( "Oelel" + user.getName () + "!");}}}). ExecuteAsync ();}}}); Overwrite public activity on your activity in:  
  @ActivityResult override public zero (int requestcode, integer result code, intent data) {/ code>  

If (session .getActiveSession ()! = Null) {session.getActivation (). OnActivityResult (this, requestcode, resultcode, data); } Super.onActivityResult (requestCode, ResultsCode, Data); }

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -