我已经开始使用Android Studio 1.0.1,因为我有这个错误,所以我无能为力,甚至无法呈现XML.
错误:无法启动守护程序进程.此问题可能是由守护程序的错误配置引起的.例如,使用无法识别的jvm选项.请参阅http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html上守护程序的用户指南章节.
初始化VM时出错无法为对象堆保留足够的空间错误:无法创建Java虚拟机.错误:发生了致命异常.程序将会退出.
有人面临同样的问题吗?
在这里,我正在尝试从我的资源文件夹中读取.pdf文件,错误显示"此文档无法打开".我尝试将.pdf文件复制到SD卡,然后从那里读取,但是没有成功.这是代码.请帮我.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
File fileBrochure = new File("/sdcard/fleetman.pdf");
if (!fileBrochure.exists())
{
CopyAssetsbrochure();
}
/** PDF reader code */
File file = new File("/sdcard/fleetman.pdf");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try
{
getApplicationContext().startActivity(intent);
}
catch (ActivityNotFoundException e)
{
Toast.makeText(MainActivity.this, "NO Pdf Viewer", Toast.LENGTH_SHORT).show();
}
}
//method to write the PDFs file to sd card
private void CopyAssetsbrochure() {
AssetManager assetManager = getAssets();
String[] files = null;
try
{
files = assetManager.list("");
}
catch (IOException …Run Code Online (Sandbox Code Playgroud)