ShellExecute extension to open update page
This commit is contained in:
parent
57ce27dfe7
commit
85641c3e1d
1 changed files with 30 additions and 1 deletions
|
@ -939,9 +939,38 @@ public class XashActivity extends Activity {
|
|||
handler.showMouse( fMouseShown );
|
||||
}
|
||||
|
||||
// Just opens browser
|
||||
public static void GenericUpdatePage()
|
||||
{
|
||||
mSingleton.startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse("https://github.com/FWGS/xash3d/releases/latest" ) ) );
|
||||
}
|
||||
|
||||
public static void PlatformUpdatePage()
|
||||
{
|
||||
// open GP
|
||||
try
|
||||
{
|
||||
mSingleton.startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse("market://details?id=in.celest.xash3d.hl") ) );
|
||||
}
|
||||
catch( android.content.ActivityNotFoundException e )
|
||||
{
|
||||
GenericUpdatePage();
|
||||
}
|
||||
}
|
||||
|
||||
// Just opens browser or update page
|
||||
public static void shellExecute( String path )
|
||||
{
|
||||
if( path.equals("PlatformUpdatePage"))
|
||||
{
|
||||
PlatformUpdatePage();
|
||||
return;
|
||||
}
|
||||
else if( path.equals( "GenericUpdatePage" ))
|
||||
{
|
||||
GenericUpdatePage();
|
||||
return;
|
||||
}
|
||||
|
||||
final Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(path));
|
||||
mSingleton.startActivity(intent);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue