Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
a13d8910
Commit
a13d8910
authored
Dec 11, 2018
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加带包名的statGooglPlay()重载
parent
90c09ce4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/main/java/tech/starwin/utils/context_utils/ActivityJumper.java
+7
-3
No files found.
src/main/java/tech/starwin/utils/context_utils/ActivityJumper.java
View file @
a13d8910
...
@@ -24,7 +24,7 @@ import tech.starwin.utils.ui_utils.DialogManager;
...
@@ -24,7 +24,7 @@ import tech.starwin.utils.ui_utils.DialogManager;
* Intent的创建和使用
* Intent的创建和使用
*/
*/
public
class
ActivityJumper
{
public
class
ActivityJumper
{
private
static
String
GP_APP_DETAIL_URL
=
"https://play.google.com/store/apps/details?id="
+
LibConfig
.
APPLICATION_ID
;
private
static
String
GP_APP_DETAIL_URL
=
"https://play.google.com/store/apps/details?id="
;
private
Intent
intent
;
private
Intent
intent
;
/**
/**
* 发起跳转的Context
* 发起跳转的Context
...
@@ -96,10 +96,14 @@ public class ActivityJumper {
...
@@ -96,10 +96,14 @@ public class ActivityJumper {
* 去 GooglePlay下载页
* 去 GooglePlay下载页
*/
*/
public
static
void
startGooglePlay
(
Context
context
)
{
public
static
void
startGooglePlay
(
Context
context
)
{
startGooglePlay
(
context
,
LibConfig
.
APPLICATION_ID
);
}
public
static
void
startGooglePlay
(
Context
context
,
String
packageName
)
{
try
{
try
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
GP_APP_DETAIL_URL
));
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
GP_APP_DETAIL_URL
+
packageName
));
List
<
ResolveInfo
>
resolveInfos
=
context
.
getPackageManager
().
queryIntentActivities
(
intent
,
0
);
List
<
ResolveInfo
>
resolveInfos
=
context
.
getPackageManager
().
queryIntentActivities
(
intent
,
0
);
if
(
resolveInfos
!=
null
&&
resolveInfos
.
size
()
>
0
){
if
(
resolveInfos
!=
null
&&
resolveInfos
.
size
()
>
0
)
{
for
(
ResolveInfo
resolveInfo
:
resolveInfos
)
{
for
(
ResolveInfo
resolveInfo
:
resolveInfos
)
{
if
(
resolveInfo
.
activityInfo
.
packageName
.
toLowerCase
().
contains
(
"com.android.vending"
)
if
(
resolveInfo
.
activityInfo
.
packageName
.
toLowerCase
().
contains
(
"com.android.vending"
)
||
resolveInfo
.
activityInfo
.
name
.
toLowerCase
().
contains
(
"com.android.vending"
)
||
resolveInfo
.
activityInfo
.
name
.
toLowerCase
().
contains
(
"com.android.vending"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment