【发布时间】:2012-04-15 02:41:35
【问题描述】:
在我的应用程序中,我想要一个按钮,按下该按钮会将存储在我的应用程序原始文件夹中的文件复制到 sdcard/Android/data... 覆盖已经存在的现有文件。
这是我目前所拥有的。例如,我的原始文件夹中的文件称为brawler.dat。
我不是要求任何人编写整个代码,但这肯定是一个奖励。
我主要需要有人为我指明正确的方向。
我可以创建按钮来访问 URL 等...但我已经准备好进入下一个级别了,我感觉。
main.xml
rLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Overwrite File" />
FreelineActivity.java
package my.freeline.conquest;
import android.app.Activity;
import android.os.Bundle;
public class FreelineActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
【问题讨论】:
标签: java android android-sdcard overwrite copying