Skip to content

Commit 4892e18

Browse files
author
keyongyu
committed
log
1 parent 8a6908c commit 4892e18

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

project/Libraries/DroidPlugin/src/com/morgoo/helper/Log.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class Log {
5151
private static final int ASSERT = android.util.Log.ASSERT;
5252
private static final long MAX_LOG_FILE = 1024 * 1024 * 8; //8MB
5353

54-
private static boolean sDebug = false;
54+
private static boolean sDebug = true;
5555
private static boolean sFileLog = false;
5656
private static final SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
5757
private static final SimpleDateFormat sFormat1 = new SimpleDateFormat("yyyyMMdd");
@@ -63,7 +63,6 @@ private Log() {
6363

6464
static {
6565
sFileLog = sDir.exists() && sDir.isDirectory();
66-
sDebug = sFileLog;
6766
}
6867

6968
public static boolean isDebug() {

project/TestPlugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747
buildTypes {
4848
release {
4949
proguardFiles getDefaultProguardFile('proguard-android.txt'), "proguard-project.txt"
50-
signingConfig signingConfigs.MySignConfig
50+
// signingConfig signingConfigs.MySignConfig
5151
}
5252
}
5353
}

project/TestPlugin/src/com/example/TestPlugin/InstalledFragment.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
import android.widget.ListView;
2727
import android.widget.TextView;
2828
import android.widget.Toast;
29+
2930
import com.morgoo.droidplugin.pm.PluginManager;
31+
import com.morgoo.helper.Log;
3032

3133
import java.util.List;
3234

@@ -47,8 +49,13 @@ public void onListItemClick(ListView l, View v, int position, long id) {
4749

4850
PackageManager pm = getActivity().getPackageManager();
4951
Intent intent = pm.getLaunchIntentForPackage(item.packageInfo.packageName);
50-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
51-
startActivity(intent);
52+
if (intent != null) {
53+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
54+
Log.i("DroidPlugin", "start " + item.packageInfo.packageName + "@" + intent);
55+
startActivity(intent);
56+
} else {
57+
Log.e("DroidPlugin", "pm " + pm.toString() + " no find intent " + item.packageInfo.packageName);
58+
}
5259
} else if (v.getId() == R.id.button3) {
5360
doUninstall(item);
5461
}

project/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include ':Libraries:DroidPlugin'
22
include ':TestPlugin'
3-
include ':Test:ApiTest'
3+
//include ':Test:ApiTest'
44
rootProject.name = 'DroidPlugin'

0 commit comments

Comments
 (0)