Created
April 8, 2013 22:14
-
-
Save emedinaa/5341006 to your computer and use it in GitHub Desktop.
Android Base
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.senamhi.projects.test; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.util.Log; | |
import android.view.Menu; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
import android.widget.TextView; | |
public class MainActivity extends Activity implements OnClickListener { | |
private TextView txt1; | |
private Button btn; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
app(); | |
} | |
private void app() { | |
// TODO Auto-generated method stub | |
//GUI | |
btn=(Button)findViewById(R.id.btnClick); | |
txt1=(TextView)findViewById(R.id.txtView); | |
//events | |
btn.setOnClickListener(this); | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
// Inflate the menu; this adds items to the action bar if it is present. | |
getMenuInflater().inflate(R.menu.activity_main, menu); | |
return true; | |
} | |
@Override | |
protected void onPause() { | |
// TODO Auto-generated method stub | |
super.onPause(); | |
} | |
@Override | |
public void onClick(View obj) | |
{ | |
// TODO Auto-generated method stub | |
switch (obj.getId()) | |
{ | |
case R.id.btnClick: | |
showText(); | |
break; | |
default: | |
break; | |
} | |
} | |
private void showText() { | |
// TODO Auto-generated method stub | |
Log.v("console","click "); | |
txt1.setText("Android2.33"); | |
//txt1.getText(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment