android - Starting activity with button -


I'm trying to configure the button 1 to change the activity, but even though I do not know of errors with Eclipse There is no button, no work, no one can tell me what is wrong Thanks after the Alprimo button 'There is another button for data backup, I do not think the problem is due to the presence of another button.

  Public class uses Aggiungi Activity OnClickListener {Personal button btn_save; Private EditingText edit_turno, edit_ore; Edit private text view_so, edit_anno; Private DbHelper mHelper; Private SQLiteDatabase database; Private string idt urn, enno, mess, turno, ore; Private Boolean isUpdate; Spinner selected Messi, selected Goroni; Private last fixed string MY_PREFERENCES = "MyPref"; Private last fixed string ANNO = "anno"; Public Zero Cambia (see footage) {Last intention cambioTermini; Cambiotechny = new intent (this, Cambio.class); Button Button = (Button) Find VVBIID (R.B. button 1); ButtonksetOnClickListener (new scene. OnClickListener () Click on {public void (see view) {startActivity (cambioTermini);}}); } @ Override Crate on Public Zero (Bundle Saved Instantstate) {Super.Nought (Saved Instantstate); SetContentView (R.layout.add_activity); Shared Prefs Prefs = getSharedPreferences (MY_PREFERENCES, Context.MODE_PRIVATE); Intent = getIntent (); String anino = prefix. Greatstring (anano, "2014"); Btn_save = (button) findViewById (R.id.save_btn); edit_mese = (TextView) findViewById (R.id.txtmese); edit_anno = (TextView) findViewById (R.id.txtanno); Edit_turno = (EditText) findViewById (R.id.turno_editTxt); Edit_ore = (EditText) findViewById (R.id.ore_editTxt); IsUpdate = getIntent () getExtras () getBoolean ("Update") .. If (isUpdate) {idturno = getIntent () GetExtras () GetString ("id"); mese = getIntent () getExtras () GetString ("Mese") .. anno = getIntent () getExtras () GetString ("Isa") .. Turno = getIntent () getExtras () GetString ("Turno") .. Ore = getIntent () getExtras () GetString ("ore") .. Edit_mese.setText (mese); Edit_anno.setText (anno); Edit_turno.setText (turno); Edit_ore.setText (ore); } Btn_save.setOnClickListener (this); MHelper = new dBelect (this); } // saveButton click on event public void onClick (see v) {mese = edit_mese.getText (). ToString () trim (); .. Anno = edit_anno.getText () toString () trim (); Turno = edit_turno.getText () toString () trim () .. . Ore = edit_ore.getText () toString () trim () .; If (anno.length () & gt; 0 & amp; amp; amp; amp; mese.length () & gt; 0 & amp; amp; amp; amp; amp; amp; amp; amp; amp; Trno. Height ()> 0 & amp; amp; ore.length ()> 0) {saveData (); } Other    

  import android.app.activity; Import android.content.Intent; Importroid.os.Bundle; Import android.view.View; Import android.widget.ImageView; Import android.widget.Toast; Public class contact activity {Public ImageView btnlog1; @ Override Protected Zero (Bundle Saved Instantstate) {Super. NET (Saved Instantstate); SetContentView (R.layout.activity_main); Btnlog1 = (imageView) findViewById (R.id.imageView2); BtnloglksetOnClickListener (new View.OnClickListener () {@Override click (click on the View public void V) {// TODO Auto-generated method stub Intent l = new Intent (contact. This, AndroidDashboardDesignActivity.class); startActivity (l ); Contact .this.finish ();}}); }}   

Use this code and try it this way. This is a simple code for the purpose of changing the other for an activity .. I know your ans ..

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 -