2. 注册ATIVITY
<activity
android:name=".Con_2Activity" >
<intent-filter >
<action android:name="android.intent.action.EDIT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
3.与自带通讯录共数据的实现
private SQLiteDatabase openDatabase0()
{
try
{
//获取数据库路径
String databaseFilename = DATABASE_PATH + "/" + DATABASE_FILENAME[0];
File dir = new File(DATABASE_PATH);
//如果路径不存在,建立
if (!dir.exists())
dir.mkdir();
//如果数据库文件不存在,建立
if (!(new File(databaseFilename)).exists())
{地铁施工生产管理安全总监述职报告
//建立数据流
InputStream is = getResources().openRawResource(R.raw.m130);
FileOutputStream fos = new FileOutputStream(databaseFilename);
byte[] buffer = new byte[1024000];
int count = 0;
//传输
while ((count = is.read(buffer)) > 0)
{
fos.write(buffer, 0, count);
}
//关闭
fos.close();
is.close();
}
}
catch (Exception e)
{
}
return null;
}