【发布时间】:2011-06-24 16:54:40
【问题描述】:
所以,我只是想再次使用属性文件,但目前我无法加载它们!我已经浪费了 1 小时的工作来完成这项工作,但不知何故我做不到。我的问题类似于this one,但是Java 就是没有得到文件!
这是我的代码:
快速打包.ProfileManager;
导入 java.io.FileInputStream; 导入 java.util.Properties;
导入android.app.Activity; 导入android.content.Context; 导入android.net.wifi.WifiManager; 导入android.os.Bundle; 导入android.view.View; 导入 android.view.View.OnClickListener; 导入 android.widget.CheckBox; 导入android.widget.Toast;
public class PMMain extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String defaultProfileProperties = "defaultProfile.properties";
Properties properties = new Properties();
properties.load(new FileInputStream(defaultProfileProperties));
...
我已经尝试在文件名前加一个“/”,但也没有用。
这是我的项目目录:
我在“properties.load ...”行收到一个 IOException
【问题讨论】:
标签: java android file properties