title: Android create own pdf reader
body: <p>i wrote code witch can to open pdf file in sdcard.but My question is there any possiblities to view Pdf files in own Layout using Xml files not static into Java files
  this is a my  code </p>
  
  <pre><code>public class MainActivity extends Activity {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Button button = (Button) findViewById(R.id.button1);
  
      button.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
  
              File pdfFile = new File(Environment
                      .getExternalStorageDirectory(), "test.pdf");
  
              try {
                  if (pdfFile.exists()) {
                      Uri path = Uri.fromFile(pdfFile);
                      Intent objIntent = new Intent(Intent.ACTION_VIEW);
                      objIntent.setDataAndType(path, "application/pdf");
                      objIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                      startActivity(objIntent);
                  } else {
                      Toast.makeText(MainActivity.this, "File NotFound",
                              Toast.LENGTH_SHORT).show();
                  }
              } catch (ActivityNotFoundException e) {
                  Toast.makeText(MainActivity.this,
                          "No Viewer Application Found", Toast.LENGTH_SHORT)
                          .show();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and also i have second question
  2) when i run project on my device i have like this screen ( </p>
  
  <p><img src="https://i.stack.imgur.com/YhYJe.png" alt="enter image description here">) when i click menu button on my device then i can to show setting menu
  it is a possible to create my own menu.for example i want to create my button witch can to zoom same as a static menu's zoom button
  thanks</p>