wait wait, the op is talking about pdf reader program or opening pdf with
any installed program ??

On Wed, Dec 29, 2010 at 3:56 PM, Robin Talwar
<r.o.b.i.n.abhis...@gmail.com>wrote:

> This is my onclick code
>
> public void onClick(View v) {
>                 // TODO Auto-generated method stub
>                 Intent i = new Intent();
>                 i.setAction(Intent.ACTION_VIEW);
>
> i.setDataAndType(Uri.parse("file:///raw/unlockingandroid.pdg"),
> "application/pdf");
>                 try{
>                     startActivity(i);
>                 }
>                  catch (ActivityNotFoundException e) {
>                      Toast.makeText(pdfviewer.this,
>                          "No Application Available to View PDF",
>                          Toast.LENGTH_SHORT).show();
>                  }
>
>             }
>
> I see a toast when i click the button :( i cant see the pdf
>
>
> On Wed, Dec 29, 2010 at 12:26 PM, Jake Basile <jakerbas...@gmail.com>wrote:
>
>> Just like opening any other type of file on Android, you should try to
>> launch an intent to view it.
>>
>> Intent openPdfIntent = new Intent();
>> intent.setAction(Intent.ACTION_VIEW);
>> intent.setDataAndType(Uri.fromFile(pdfFile), "application/pdf");
>> try
>> {
>>     startIntent(openPdfIntent);
>> }
>> catch(ActivityNotFoundException e)
>> {
>>     // No app can open PDF files on their phone.
>> }
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
http://geek.s4a.cc

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to