quran / quran_android

a quran reading application for android

Home Page:http://android.quran.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support intent to jump

ahmedre opened this issue · comments

support an intent to allow people outside to jump to a certain page, sura, or sura/ayah combo.

support added for Intent.ACTION_VIEW with data of quran://sura/ayah.

example:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("quran://3/100");
PackageManager pm = getPackageManager();
if (pm.queryIntentActivities(i, 0).size() == 0){
   i.setData(Uri.parse("http://quran.com/3/100"));
}
startActivity(i);

this code will see if quran android (or any other app) can handle a view intent with a quran:// url. if no such app is installed, it falls back to launching the ayah in a web browser.