mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
use constant APPLICATION_ID instead of method call
This commit is contained in:
parent
89c103ab4c
commit
451d2a271e
4 changed files with 5 additions and 5 deletions
|
@ -621,7 +621,7 @@ public class DictUtils {
|
||||||
File storage = Environment.getExternalStorageDirectory();
|
File storage = Environment.getExternalStorageDirectory();
|
||||||
if ( null != storage ) {
|
if ( null != storage ) {
|
||||||
String packdir = String.format( "Android/data/%s/files/",
|
String packdir = String.format( "Android/data/%s/files/",
|
||||||
context.getPackageName() );
|
BuildConfig.APPLICATION_ID );
|
||||||
result = new File( storage.getPath(), packdir );
|
result = new File( storage.getPath(), packdir );
|
||||||
if ( !result.exists() ) {
|
if ( !result.exists() ) {
|
||||||
result.mkdirs();
|
result.mkdirs();
|
||||||
|
|
|
@ -1580,7 +1580,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
|
|
||||||
case R.id.games_menu_rateme:
|
case R.id.games_menu_rateme:
|
||||||
String str = String.format( "market://details?id=%s",
|
String str = String.format( "market://details?id=%s",
|
||||||
m_activity.getPackageName() );
|
BuildConfig.APPLICATION_ID );
|
||||||
try {
|
try {
|
||||||
startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse( str ) ) );
|
startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse( str ) ) );
|
||||||
} catch ( android.content.ActivityNotFoundException anf ) {
|
} catch ( android.content.ActivityNotFoundException anf ) {
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
|
||||||
{
|
{
|
||||||
JSONObject params = new JSONObject();
|
JSONObject params = new JSONObject();
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
String packageName = context.getPackageName();
|
String packageName = BuildConfig.APPLICATION_ID;
|
||||||
int versionCode;
|
int versionCode;
|
||||||
try {
|
try {
|
||||||
versionCode = pm.getPackageInfo( packageName, 0 ).versionCode;
|
versionCode = pm.getPackageInfo( packageName, 0 ).versionCode;
|
||||||
|
|
|
@ -514,7 +514,7 @@ public class Utils {
|
||||||
if ( null == s_appVersion ) {
|
if ( null == s_appVersion ) {
|
||||||
try {
|
try {
|
||||||
int version = context.getPackageManager()
|
int version = context.getPackageManager()
|
||||||
.getPackageInfo(context.getPackageName(), 0)
|
.getPackageInfo(BuildConfig.APPLICATION_ID, 0)
|
||||||
.versionCode;
|
.versionCode;
|
||||||
s_appVersion = new Integer( version );
|
s_appVersion = new Integer( version );
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
|
@ -558,7 +558,7 @@ public class Utils {
|
||||||
public static boolean isGooglePlayApp( Context context )
|
public static boolean isGooglePlayApp( Context context )
|
||||||
{
|
{
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
String packageName = context.getPackageName();
|
String packageName = BuildConfig.APPLICATION_ID;
|
||||||
String installer = pm.getInstallerPackageName( packageName );
|
String installer = pm.getInstallerPackageName( packageName );
|
||||||
boolean result = "com.google.android.feedback".equals( installer )
|
boolean result = "com.google.android.feedback".equals( installer )
|
||||||
|| "com.android.vending".equals( installer );
|
|| "com.android.vending".equals( installer );
|
||||||
|
|
Loading…
Add table
Reference in a new issue