public class mainactivity extends activity {
private static final string app_id = "a7ab0fe5f11edc8afbfbc842ecc38ad7";
string a = null;
@override
protected void oncreate(bundle savedinstancestate) {
super.oncreate(savedinstancestate);
setcontentview(r.layout.activity_main);
button button = (button) findviewbyid(r.id.button1);
button.setonclicklistener(new onclicklistener() {
@override
public void onclick(view v) {
a.charat(23);
}
});
checkforupdates();
}
@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
protected void onresume() {
// todo auto-generated method stub
super.onresume();
checkforcrashes();
}
private void checkforcrashes() {
crashmanager.register(this, app_id, new crashmanagerlistener() {
@override
public void oncrashessent() {
super.oncrashessent();
runonuithread(new runnable() {
@override
public void run() {
toast.maketext(getapplicationcontext(),
"crash data was sent. thanks!",
toast.length_long).show();
}
});
}
@override
public void oncrashesnotsent() {
super.oncrashesnotsent();
runonuithread(new runnable() {
@override
public void run() {
toast.maketext(
getapplicationcontext(),
"crash data failed to sent. please try again later.",
toast.length_long).show();
}
});
}
});
}
private void checkforupdates() {
// remove this for store builds!
updatemanager.register(this, app_id);
}
}
如对本文有疑问, 点击进行留言回复!!
Codeforces C. A Cookie for You (模拟 / 分类 / 贪心) (Round #654 Div.2)
DialogFragment弹窗(带黑色透明背景和不带黑色透明背景)
网友评论