Pro13Activity.java
package ps.pro13;
import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TextView;
public class Pro13Activity extends Activity {
/**
* www.master-gtu.blogspot.com
* pankaj sharma(8460479175),
* chavda vijay(8460420769)
*/
TextView txtmsg;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txtmsg=(TextView) findViewById(R.id.TextViewmsgs);
Uri u=Uri.parse("content://sms/inbox");
Cursor cur=managedQuery(u, null, null, null, null);
String msg="";
while(cur.moveToNext())
{
msg+=cur.getString(2)+":\n\t"+cur.getString(11)+"\n\n";
}
txtmsg.setText(msg);
}
}
very useful to read ur coding for viewing the messages on screen is nice easily understandable
ReplyDeleteJava Training in Chennai
Dot Net Training in Chennai
Cloud Computing Training in Chennai
Digital Marketing Training in Chennai