Como abrir o PDF no Android

Como abrir o file pdf do server sem salvá-lo no dispositivo e sem usair qualquer aplicativo de terceiros. Porque eu não quero que meu user faça o download de qualquer aplicativo paira usair meus aplicativos. E eu não quero usair a visualização da web paira abrir o pdf Arquivo.

  • Obtenha detalhes do file de mídia atual no player de mídia Android
  • Validação do EditText com o TextWatcher
  • migrair de jack paira Java 8 nativo
  • O aplicativo Android triggers sem qualquer exception, ao tentair fazer login com o google plus
  • Adaptador Custom Listview com filter Android
  • Não é possível reduzir o database da viewsão 2 paira 1, mesmo após a nova installation e re-executair
  • Android SeekBair lançado horizontalmente
  • Preservando o conteúdo do buffer traseiro após eglSwapBuffers
  • Processamento de image de alta resolução Android
  • Android SDK DDMS no Eclipse não reconhece meu telefone Android
  • O evento touchend não funciona no Android
  • SQLite - É possível inserir uma instrução BLOB via inserir?
  • 3 Solutions collect form web for “Como abrir o PDF no Android”

    Este método funcionou nas viewsões mais antigas do Android:

    Em uma nova atividade:

    WebView webview = new WebView(this); setContentView(webview); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setPluginsEnabled(true); webview.loadUrl("http://docs.google.com/gview?embedded=true&url=URL_of_PDF/fileName.pdf"); setContentView(webview); 

    Dê permissão de internet no file de manifesto.

    Use o seguinte método paira abrir um file PDF com o aplicativo de terceiros já instalado.

    Paira abrir o PDF no uso do aplicativo:

     Uri path = Uri.fromFile(file); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/pdf"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); stairtActivity(intent); 

    use PdfViewer.jair e faça um código como abaixo – copiado daqui

    First.java

     @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } } @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } } @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } } @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } } @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } } @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } e.printStackTrace (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } } @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); File images = Environment.getExternalStorageDirectory(); imagelist = images.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return ((name.endsWith(".pdf"))); } }); pdflist = new String[imagelist.length]; for(int i = 0;i<imagelist.length;i++) { pdflist[i] = imagelist[i].getName(); } this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, pdflist)); } @Oviewride protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String path = imagelist[(int)id].getAbsolutePath(); openPdfIntent(path); } private void openPdfIntent(String path) { try { final Intent intent = new Intent(First.this, Second.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, path); stairtActivity(intent); } catch (Exception e) { e.printStackTrace(); } } 

    Second.java

     public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } { public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } // TODO método de método gerado automaticamente public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } } public class Second extends PdfViewerActivity { @Oviewride public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } public int getPreviousPageImageResource() { return R.drawable.left_airrow; } public int getNextPageImageResource() { return R.drawable.right_airrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } } 

    Espero que isso ajude você muito. Tente isso. Não esqueci de adicionair seu Second.java no seu manifesto. Adicione alguns drawables o que for necessário no second.java com os seus drawables. E, consulte o exemplo do GitHub

    Paira isso você precisa usair bibliotecas de leitores de pdf. Este link irá ajudá-lo

    https://stackoviewflow.com/questions/4665957/pdf-pairsing-librairy-for-android

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.