3g嵌入式短学期实习报告 - 图文(5)

2019-03-28 16:28

super.onCreate(savedInstanceState); setContentView(R.layout.main);

GetAssets getAssest = new GetAssets(this, \); int[][] map = new int [26][26]; map = getAssest.getMap();

RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.rlo);

Maplyout maplyout = new Maplyout(this, \); relativeLayout.addView(maplyout); }

}

public class GetAssets { }

byte[] buffer;

public GetAssets(Context context, String str) { }

public int[][] getMap() { }

int[][] map = new int[26][26]; for (int i = 0; i < 26; i++) { }

return map;

for (int j = 0; j < 26; j++) { }

map[i][j] = buffer[j + i * 28] - 48;

try {

InputStream in = context.getAssets().open(str); int size = in.available(); buffer = new byte[size]; in.read(buffer); in.close();

} catch (IOException e) { }

e.printStackTrace();

6.ZUCC系统

public class LoginActivity extends Activity{

Bundle buddle = new Bundle() ;

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState); setContentView(R.layout.login);

final EditText etname = (EditText) this.findViewById(R.id.etloginname); final EditText etpass = (EditText) this.findViewById(R.id.etloginpass);

Button btlogin = (Button) this.findViewById(R.id.btlogin); Button btreg = (Button) this.findViewById(R.id.btreg); btreg.setOnClickListener(new OnClickListener() {

public void onClick(View v) {

Intent intent = new

Intent(LoginActivity.this,RegActivity.class);

}

startActivity(intent);

});

btlogin.setOnClickListener(new OnClickListener() {

public void onClick(View v) {

String username = etname.getText().toString().trim(); String passord = etpass.getText().toString().trim(); if(username.equals(\)||passord.equals(\)){

Toast.makeText(LoginActivity.this, \用户名和密码不能为空\,

Toast.LENGTH_LONG).show();

}else if(username.equals(\)&&passord.equals(\)){

Toast.makeText(LoginActivity.this, \登陆成功\, buddle.putString(\,username); Intent intent = new

Toast.LENGTH_LONG).show();

Intent(LoginActivity.this,SelectActivity.class);

} }

public class RegActivity extends Activity {

AlertDialog ad; int imgPosition; ImageButton ibs;

int[] imgs = { R.drawable.m01, R.drawable.m02, R.drawable.m03,

R.drawable.m04, R.drawable.m05, R.drawable.m06, R.drawable.m07, R.drawable.m08, R.drawable.m09, R.drawable.m10, R.drawable.m11, R.drawable.m12, R.drawable.m13, R.drawable.m14, R.drawable.m15,

}

intent.putExtra(\, username); startActivity(intent);

}else{ }

Toast.makeText(LoginActivity.this, \用户名或密码错误\,

Toast.LENGTH_LONG).show();

});

R.drawable.m16, R.drawable.m17, R.drawable.m18,};

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState); setContentView(R.layout.reg);

ibs = (ImageButton) this.findViewById(R.id.ibselect);

final EditText etpass = (EditText) this.findViewById(R.id.etregpass);

final EditText etcontpass = (EditText) this.findViewById(R.id.etregcon);

final EditText etuser = (EditText) this.findViewById(R.id.etreguname);

Button back = (Button) this.findViewById(R.id.btback); Button btreg = (Button) this.findViewById(R.id.btreg); Button resect = (Button) this.findViewById(R.id.btreset); btreg.setOnClickListener(new OnClickListener() {

public void onClick(View v) {

String uname = etuser.getText().toString().trim(); String pass = etpass.getText().toString().trim(); String con = etcontpass.getText().toString().trim(); if (uname.equals(\)) {

Toast.makeText(RegActivity.this, \用户名不能为空\,

Toast.LENGTH_LONG).show();

} else if (!pass.equals(\) && !con.equals(\)

&& pass.equals(con)) {

Toast.makeText(RegActivity.this, \两次密码输入一致\,

Toast.LENGTH_LONG).show();

Intent intent = new Intent(RegActivity.this,

LoginActivity.class);

startActivity(intent);

} else {

Toast.makeText(RegActivity.this, \两次密码输入不一致或密码为空\, }

}

Toast.LENGTH_LONG).show();

});

ibs.setOnClickListener(new OnClickListener() {

public void onClick(View v) { }

initDialog(); ad.show();

}

});

public void initDialog() {

AlertDialog.Builder adb = new

AlertDialog.Builder(RegActivity.this);

class MyAdapter extends BaseAdapter {

private Context context;

public MyAdapter(Context context) { }

public int getCount() {return imgs.length;}

this.context = context;

adb.setTitle(\选择图像\);

public void onClick(DialogInterface dialog, int which) { }

ibs.setImageResource(imgs[imgPosition]);

adb.setPositiveButton(\确定\, new DialogInterface.OnClickListener() {

});

adb.setNegativeButton(\取消\, new DialogInterface.OnClickListener() { }

public void onClick(DialogInterface dialog, int which) { }

});

LayoutInflater inflater = LayoutInflater.from(RegActivity.this); View view = inflater.inflate(R.layout.imgswitch, null); Gallery gallery = (Gallery) view.findViewById(R.id.gallery); gallery.setOnItemClickListener(new OnItemClickListener() {

public void onItemClick(AdapterView arg0, View arg1, int arg2, }

long arg3) {

imgPosition = arg2;

ibs.setImageResource(arg2);

});

gallery.setAdapter(new MyAdapter(this)); gallery.setSelection(imgs.length / 2); adb.setView(view); ad = adb.create();


3g嵌入式短学期实习报告 - 图文(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:九年级化学下册 第十单元 课题2 酸和碱的中和反应(第1课时)教

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: