当前位置: 编程技术>移动开发
本页文章导读:
▪本土程序打开其它程序 本地程序打开其它程序
Intent i = new Intent("android.intent.action.MAIN");
i.setComponent(new ComponentName(packageName, className));
startActivity(i);
packageName包名
className类名
......
▪ fill_parent和wrap_content的有关问题 fill_parent和wrap_content的问题
Android学习ING,遇到一个错误.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width=.........
▪ 稽查盘volumn是否可以写入 检查盘volumn是否可以写入
通过创建一个临时文件来确定是否盘可写。注意不要把文件放在根目录,因为根目录会现在文件的数目private static boolean checkFsWritable() {
// Create a temporary file .........
[1]本土程序打开其它程序
来源: 互联网 发布时间: 2014-02-18
本地程序打开其它程序
Intent i = new Intent("android.intent.action.MAIN");
i.setComponent(new ComponentName(packageName, className));
startActivity(i);
packageName包名
className类名
[2] fill_parent和wrap_content的有关问题
来源: 互联网 发布时间: 2014-02-18
fill_parent和wrap_content的问题
Android学习ING,遇到一个错误.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:background="#0000FF">
<TextView
android:text="请输入用户名:"
android:id="@+id/label"
android:layout_width="fill_content"
android:layout_height="wrap_content" />
</RelativeLayout>
报错:
error: Error: String types not allowed (at 'layout_width' with value 'fill_content').
为什么?按照书上的代码打的!实在不知道错在哪儿了!囧!
[3] 稽查盘volumn是否可以写入
来源: 互联网 发布时间: 2014-02-18
检查盘volumn是否可以写入
通过创建一个临时文件来确定是否盘可写。注意不要把文件放在根目录,因为根目录会现在文件的数目
通过创建一个临时文件来确定是否盘可写。注意不要把文件放在根目录,因为根目录会现在文件的数目
private static boolean checkFsWritable() {
// Create a temporary file to see whether a volume is really writeable.
// It's important not to put it in the root directory which may have a
// limit on the number of files.
String directoryName =
Environment.getExternalStorageDirectory().toString() + "/DCIM";
File directory = new File(directoryName);
if (!directory.isDirectory()) {
if (!directory.mkdirs()) {
return false;
}
}
File f = new File(directoryName, ".probe");
try {
// Remove stale file if any
if (f.exists()) {
f.delete();
}
if (!f.createNewFile()) {
return false;
}
f.delete();
return true;
} catch (IOException ex) {
return false;
}
}
最新技术文章: