我正在尝试从收件箱中读取邮件并将其显示在活动中.我的活动包含一个按钮和列表视图.单击该按钮时,将显示收件箱中的所有消息.但我的要求是我需要查看来自特定号码的消息.当我点击单击按钮时,只有特定消息(与特定号码相关联)必须更新时,我的应用程序才会运行.这是相关的代码.
myActivity.java:
public class SecureMessagesActivity extends Activity implements OnClickListener, OnItemClickListener {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme( android.R.style.Theme_Light );
setContentView(R.layout.main);
this.findViewById( R.id.UpdateList ).setOnClickListener( this );
}
ArrayList<String> smsList = new ArrayList<String>();
public void onItemClick( AdapterView<?> parent, View view, int pos, long id ) {
try {
String[] splitted = smsList.get( pos ).split("\n");
String sender = splitted[0];
String encryptedData = "";
for ( int i = 1; i < splitted.length; ++i ) {
encryptedData += splitted[i];
}
String data = …Run Code Online (Sandbox Code Playgroud)