I am trying to use asynctask to upload the unit as a Google hello tutorial to mobile assistants I put the code in the bottom so it works but if I try to use the code in any other activity (in this case MakeDesire.java) then it does not work. There are problems:
1) New Desire Task () Execute () .......... DesireTask has been underlined and says that create new squares. 2) Eclipse is not to give the desire of the private class (Task) ..... When the locally inventor's wish to click on the "Moderator, only the abstract or the final permission is granted" but in the main activity Works
Any help is epicatted Thanks in advance.
Package com.google.samplesolutions.mobileassistant; Import java.io.IOException; Import com.google.api.client.extensions.android.http.AndroidHttp; Import com.google.api.client.json.jackson2.JacksonFactory; Import com.google.samplesolutions.mobileassistant.desireendpoint.Desireendpoint; Import com.google.samplesolutions.mobileassistant.desireendpoint.model.Desire; Public Class MakeDesire Activity Extension (Private OnTouchListener sendexit = null; @ Override Protected Zero to Create (Bundle Saved Instestat) {Super.New (Saved Instantstate); setContentView (R.layout.sss); Button Button 1 = (Button Find VVBiID (R.B. button 1); Editing Tag Quetetry = (EditText) Find VVBIID (RID Edit Text 1); Last String ktgri = kategori.getText (). ToString (); EditText mal = (EditText) findViewById ( R.id.editText2); Last string malstring = mal.getText (). ToString (); Find the last checkbox ARRM = (checkbox) VVBIID (RID checkbox 1); Sendexit = new onTouchListener () {@ Override Public Boolean On Touch (see V, Motion Event Event) {if (event.getAction () == Motion Avent. Action_up) {New Dyjeratsky (); Execute (); Finish (); Back True;} Details are False;}} button1.setOnTouchListener (sendexit); Class Wish Task Async Task & , Zero, Zero & gt; {@Override Safe Wide Doign Background (Zero ... arg0) {I Interpretation = new com.google.samplesolutions.mobileassistant.desireendpoint.model.Desire (); Desire.setCtgry (ktgri); Desire.setGood (malstring); Desire.setAlarm (alrm.isChecked ()); Desireendpoint.Builder Builder = New Desireendpoint.Builder (AndroidHttp.newCompatibleTransport (), New JacksonFactory (), blank); Builder = CloudEndpointUtils.updateBuilder (Builder); Desireendpoint endpoint = builder.build (); Try {endpoint.insertDesire (wish). Execute (); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTrace (); } Return tap; It seems that you are sticking to the inner class inside onCreate
method to declare the task and the body to bite and paste it out of onCreate
try.
Comments
Post a Comment