<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.leavesystem">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.AdminLoginActivity">
</activity>
<activity android:name=".activities.StudentLoginActivity">
</activity>
</application>
</manifest>
Install failed.
Installation failed
< a href=’ '>Rerun a>
解决方案:
简单粗暴,重新配置一个虚拟机。
在Activity1中:
Intent intent = new Intent(Activity1.this,Activity2.class);
intent.putExtra("id", username.getText().toString());
startActivity(intent);
在Activity2中:
private String ID;
intent = getIntent();
ID = intent.getStringExtra("id");
final EditText code = (EditText)textEntryView.findViewById(R.id.et_rcode_reg);
android:descendantFocusability="blocksDescendants"
=MID($L$1,RANDBETWEEN(1,100),1)
同理,通过如下公式获取第二三个字(名字存放在M1中);
=MID($M$1,RANDBETWEEN(1,100),1)
通过如下公式随机生成二字或三字姓名(L2存放生成的姓氏,M2和N2存放生成的第二个和第三个名字)。
=MID((L2&M2&N2),1,RANDBETWEEN(2,3))
参考:
如何在excel中随机生成姓名
如何使用Excel随机生成手机号码听语音
100个常见姓氏:
李王张刘陈杨赵黄周吴徐孙胡朱高林何郭马罗梁宋郑谢韩唐冯于董萧程曹袁邓许傅沈曾彭吕苏卢蒋蔡贾丁魏薛叶阎余潘杜戴夏钟汪田任姜范方石姚谭廖邹熊金陆郝孔白崔康毛邱秦江史顾侯邵孟龙万段漕钱汤尹黎易常武乔贺赖龚文
常见名字所带的字:
蔼仁容德轩贤良伦正清义诚直道颖灵睿锐哲慧敦迪明晓显悉晰维学思悟析文书勤俊威英健壮焕挺帅秀伟武雄巍松柏山石婵娟姣妯婷姿媚婉丽妩美倩兰达耀兴荣华旺盈丰余昌盛安静顺通坦泰然宁定和康睿浩博瑞昊悦妍涵玥蕊子梓浩宇俊轩宇泽杰豪雨梓欣子思涵萱怡彤琪
android:orientation="horizontal"
private RadioGroup sex;
private RadioButton boy;
private RadioButton girl;
private String sexName;
sex= (RadioGroup) findViewById(R.id.rg_sex);
girl= (RadioButton) findViewById(R.id.rb_girl);
boy= (RadioButton) findViewById(R.id.rb_boy);
sex.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (boy.getId() == checkedId) {
sexName = boy.getText().toString();
} else if (girl.getId() == checkedId) {
sexName = girl.getText().toString();
}
}
});
android.database.sqlite.SQLiteException: table student has no column named sname (code 1): , while compiling:
INSERT student (sno,sname,sex) VALUES (?,?,?)
解决方法:
将APP卸了重装。
参考:
错误:adroid.database.sqlite.SQLiteException: table USER has no column named ID (code 1):
java.lang.NullPointerException: Attempt to invoke virtual method ‘android.database.sqlite.SQLiteDatabase com.example.leavesystem.databases.MyDatabaseHelper.getWritableDatabase()’ on a null object reference
解决方法:
在类的开头初始化MyDatabaseHelper 和Intent
private MyDatabaseHelper dbHelper;
private Intent intent;
在onCreate下缺少了如下代码
dbHelper = MyDatabaseHelper.getInstance(this);
intent = getIntent();
出错代码:
viewHolder.tvsno.setText(student.getSno());
解决方法:
viewHolder.tvsno.setText(Integer.toString(student.getSno()));
参考:
android NotFoundException: String resource ID #0x1
Intent intent = getIntent();
int sno= intent.getIntExtra("sno",1);
tvsno.setText(String.valueOf(sno));
java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.TextView.setText(java.lang.CharSequence)’ on a null object reference
解决方法:
检查layout是否与控件相对应。
参考:
void android.widget.TextView.setText(java.lang.CharSequence)’ on a null object reference
android.content.res.Resources$NotFoundException: String resource ID #0x1
解决方法:
viewHolder.tvldays.setText(String.valueOf(history.getLdays()));
原因:
history.getLdays()是int类型数据。
(1) 由于数据在view上可以直接从view里面获取
TextView tv_city = (TextView) view.findViewById(R.id.tv_city);
String city = tv_city.getText().toString();
(2) 知道数据的下标可以从数据里面直接获取
String city = citys[position];
(3) 从Spinner身上直接获取
String city = (String) spinner.getSelectedItem();
(3)从adapter获取
String city = adapter.getItem(position);
AdminAddActivity.this.finish();