Skip to content

Instantly share code, notes, and snippets.

@murano500k
Created April 12, 2017 08:04
Show Gist options
  • Save murano500k/005e0335ad4b9dadac132b126379c345 to your computer and use it in GitHub Desktop.
Save murano500k/005e0335ad4b9dadac132b126379c345 to your computer and use it in GitHub Desktop.
Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/html"); intent.putExtra(Intent.EXTRA_EMAIL, "[email protected]"); intent.putExtra(Intent.EXTRA_SUBJECT, "Subject"); intent.putExtra(Intent.EXTRA_TEXT, "I'm email body."); startActivity(Intent.createChooser(intent, "Send Email"));Jan 2, 2012
http://umeshisran4android.blogspot.com/2015/11/how-to-readparse-ussd-messages.html
read sms
Intent intent = getIntent();
Bundle bundle = intent.getBundleExtra("mySMS");
if (bundle != null) {
Object[] pdus = (Object[])bundle.get("pdus");
SmsMessage sms = SmsMessage.createFromPdu((byte[])pdus[0]);
Log.i("mobile.cs.fsu.edu", "smsActivity : SMS is <" + sms.getMessageBody() +">");
//strip flag
String message = sms.getMessageBody();
while (message.contains("FLAG"))
message = message.replace("FLAG", "");
TextView tx = (TextView) findViewById(R.id.TextBox);
tx.setText(message);
} else
Log.i("mobile.cs.fsu.edu", "smsActivity : NULL SMS bundle");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment