问题描述
我试图集成muPDF,但是只显示了一个带有“关闭”按钮的空白对话框。 目的是通过单击浮动按钮来显示PDF。我的条件之一是 有什么想法,我做错了什么? 我使用“ import com.artifex.mupdf.viewer.DocumentActivity;”导入了muPDF Viewer。并按照首页上的说明安装了MuPDF。
公共类SingleWFActivity扩展了AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.singlewf_activity);
Intent singleWF = getIntent(); //sets ID of Workflow
int editableWfId = singleWF.getIntExtra("Item",0); //Is needed for getting the right
PDF
FloatingActionButton nextStep = (FloatingActionButton)
findViewById(R.id.nextStep_invoice);
nextStep.setonClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setNextStep();
Toast.makeText(SingleWFActivity.this,"Workflow in die nächste Stufe gehoben.",Toast.LENGTH_LONG).show();
Intent ready = new Intent(SingleWFActivity.this,MainActivity.class);
startActivity(ready);
finish();
}
});
FloatingActionButton seePDF = (FloatingActionButton) findViewById(R.id.seePDF);
seePDF.setonClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri documentUri = Uri.parse("http://www.jena.de/fm/41/test.pdf");
startMuPDFActivity(documentUri);
}
});
}
public void startMuPDFActivity(Uri documentUri) {
Intent intent = new Intent(this,DocumentActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.setData(documentUri);
startActivity(intent);
}
public int getActualStep() {
//Todo: Getting a file,which provides some database like structures for setting up the
nextStep()
int stage = 0;
return stage;
}
public int setNextStep() {
int actualStage = getActualStep();
int steps = actualStage;
steps++;
return steps;
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)