android:windowSoftInputMode="stateVisible|adjustResize"
android:theme="@android:style/Theme.NoTitleBar"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.CustomDialog"
android:theme="@style/Theme.Translucent"
android:theme="@style/Theme.Transparent"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("audio/*");
startActivity(Intent.createChooser(intent, "Select music"));
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
友情提供了另一种方法:(得自峰的真传)
new NullPointerException("No focus window, dropping: ").printStackTrace();
java.util.Map<Thread, StackTraceElement[]> ts = Thread.getAllStackTraces();
StackTraceElement[] ste = ts.get(Thread.currentThread());
for (StackTraceElement s : ste) {
android.util.Log.d("SS ", s.toString());
}
Throwable tr = new Throwable();
tr.fillInStackTrace();
Log.v(TAG,"",tr);
打印JAVA调用栈方法
try {
throw new Exception();
} catch (Exception ex) {
Log.e("pan", "=======sssss======");
ex.printStackTrace();
}
有时候需要了解一段代码调用时的调用栈,方便定位问题,使用上面的方法可以打印调用栈,很方便。
打印结果如下:从下向上是调用逻辑。
01-01 11:47:46.546: ERROR/pan(1049): ========AAAAAAAA======
01-01 11:47:46.546: WARN/System.err(1049): java.lang.Exception
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.setHeight(PopupWindow.java:619)
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1160)
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1136)
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1275)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1238)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1170)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.AutoCompleteTextView$PopupTouchInterceptor.onTouch(AutoCompleteTextView.java:1428)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.PopupWindow$PopupViewContainer.dispatchTouchEvent(PopupWindow.java:1352)
01-01 11:47:46.556: WARN/System.err(1049): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
01-01 11:47:46.556: WARN/System.err(1049): at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 11:47:46.556: WARN/System.err(1049): at android.os.Looper.loop(Looper.java:123)
01-01 11:47:46.556: WARN/System.err(1049): at android.os.HandlerThread.run(HandlerThread.java:60)
android:theme="@android:style/Theme.NoTitleBar"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.CustomDialog"
android:theme="@style/Theme.Translucent"
android:theme="@style/Theme.Transparent"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("audio/*");
startActivity(Intent.createChooser(intent, "Select music"));
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
友情提供了另一种方法:(得自峰的真传)
new NullPointerException("No focus window, dropping: ").printStackTrace();
java.util.Map<Thread, StackTraceElement[]> ts = Thread.getAllStackTraces();
StackTraceElement[] ste = ts.get(Thread.currentThread());
for (StackTraceElement s : ste) {
android.util.Log.d("SS ", s.toString());
}
Throwable tr = new Throwable();
tr.fillInStackTrace();
Log.v(TAG,"",tr);
打印JAVA调用栈方法
try {
throw new Exception();
} catch (Exception ex) {
Log.e("pan", "=======sssss======");
ex.printStackTrace();
}
有时候需要了解一段代码调用时的调用栈,方便定位问题,使用上面的方法可以打印调用栈,很方便。
打印结果如下:从下向上是调用逻辑。
01-01 11:47:46.546: ERROR/pan(1049): ========AAAAAAAA======
01-01 11:47:46.546: WARN/System.err(1049): java.lang.Exception
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.setHeight(PopupWindow.java:619)
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1160)
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1136)
01-01 11:47:46.546: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1275)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.PopupWindow.update(PopupWindow.java:1238)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1170)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.AutoCompleteTextView$PopupTouchInterceptor.onTouch(AutoCompleteTextView.java:1428)
01-01 11:47:46.556: WARN/System.err(1049): at android.widget.PopupWindow$PopupViewContainer.dispatchTouchEvent(PopupWindow.java:1352)
01-01 11:47:46.556: WARN/System.err(1049): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
01-01 11:47:46.556: WARN/System.err(1049): at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 11:47:46.556: WARN/System.err(1049): at android.os.Looper.loop(Looper.java:123)
01-01 11:47:46.556: WARN/System.err(1049): at android.os.HandlerThread.run(HandlerThread.java:60)