Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.http.protocol.HTTP;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.support.v7.app.ActionBarActivity;
- import android.view.Menu;
- import android.view.MenuItem;
- import android.view.View;
- public class MainActivity extends ActionBarActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- }
- public void Bnt_ActionView (View view) {
- // Intent intent = new Intent(this, LinearLayoutActivity.class);
- // startActivity(intent);
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setData(Uri.parse("http://www.google.com"));
- startActivity(intent);
- }
- public void Bnt_ActionDial (View view) {
- Intent intent = new Intent(Intent.ACTION_DIAL);
- startActivity(intent);
- }
- public void Bnt_ActionDialCall (View view) {
- Intent intent = new Intent(Intent.ACTION_CALL);
- intent.setData(Uri.parse("tel:5524741704"));
- startActivity(intent);
- }
- public void Bnt_GoogleMaps(View view) {
- Intent intent = new Intent(Intent.ACTION_VIEW,
- Uri.parse("geo:41.656313,-0.877351"));
- startActivity(intent);
- }
- public void Bnt_TakePicture(View view) {
- Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
- startActivity(intent);
- }
- public void Bnt_Email(View view) {
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType("text/plain");
- intent.putExtra(Intent.EXTRA_SUBJECT, "asunto");
- intent.putExtra(Intent.EXTRA_TEXT, "texto del correo");
- intent.putExtra(Intent.EXTRA_EMAIL,
- new String[] {"omendoza@arcelia.net" });
- startActivity(intent);
- }
- public void Bnt_MmsMessage(View view) {
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType(HTTP.PLAIN_TEXT_TYPE);
- intent.putExtra("sms_body", "Mensaje de Prueba");
- startActivity(intent);
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.main, menu);
- return true;
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement