AndroidFrameX是一个关于Android的快速开发框架,尽在最短的时间,最少的代码快速的完成开发任务。
public void onCreate() { // TODO Auto-generated method stub super.onCreate(); UtilsX.init(this); } 在Application中,且在AndroidMainfest.xml.
name="....你的Application".
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initbackToolbar(); setContentView(R.layout.activity_main); setTitle("有英雄的国家是可悲的");
}
需要在App Theme中设置NoActionbar 在style中设置颜色Toolbar
button3.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { // TODO Auto-generated method stub SendUdpX send=new SendUdpX("192.168.12.1",123); send.sendUdpData("test", new CommonCallback<String>() { @Override public void onSuccess(String arg0) { // TODO Auto-generated method stub ToastX.ToastSuccess(MainActivity.this,"udp success"); } @Override public void onFinished() { // TODO Auto-generated method stub } @Override public void onError(Throwable arg0, boolean arg1) { // TODO Auto-generated method stub ToastX.ToastFair(MainActivity.this,"udp error"); } @Override public void onCancelled(CancelledException arg0) { // TODO Auto-generated method stub } }); } });