本文整理汇总了Java中android.util.PrintWriterPrinter类的典型用法代码示例。如果您正苦于以下问题:Java PrintWriterPrinter类的具体用法?Java PrintWriterPrinter怎么用?Java PrintWriterPrinter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PrintWriterPrinter类属于android.util包,在下文中一共展示了PrintWriterPrinter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dump
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
super.dump(fd, fout, args);
final Printer p = new PrintWriterPrinter(fout);
p.println("LatinIME state :");
p.println(" Keyboard mode = " + mKeyboardSwitcher.getKeyboardMode());
p.println(" mCapsLock=" + mCapsLock);
p.println(" mComposing=" + mComposing.toString());
p.println(" mPredictionOn=" + mPredictionOn);
p.println(" mCorrectionMode=" + mCorrectionMode);
p.println(" mPredicting=" + mPredicting);
p.println(" mAutoCorrectOn=" + mAutoCorrectOn);
p.println(" mAutoSpace=" + mAutoSpace);
p.println(" mCompletionOn=" + mCompletionOn);
p.println(" TextEntryState.state=" + TextEntryState.getState());
p.println(" mSoundOn=" + mSoundOn);
p.println(" mVibrateOn=" + mVibrateOn);
p.println(" mPopupOn=" + mPopupOn);
}
示例2: dumpInner
import android.util.PrintWriterPrinter; //导入依赖的package包/类
void dumpInner(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
writer.print(prefix); writer.print("Local Activity ");
writer.print(Integer.toHexString(System.identityHashCode(this)));
writer.println(" State:");
String innerPrefix = prefix + " ";
writer.print(innerPrefix); writer.print("mResumed=");
writer.print(mResumed); writer.print(" mStopped=");
writer.print(mStopped); writer.print(" mFinished=");
writer.println(mFinished);
writer.print(innerPrefix); writer.print("mChangingConfigurations=");
writer.println(mChangingConfigurations);
writer.print(innerPrefix); writer.print("mCurrentConfig=");
writer.println(mCurrentConfig);
mFragments.dumpLoaders(innerPrefix, fd, writer, args);
mFragments.getFragmentManager().dump(innerPrefix, fd, writer, args);
if (mVoiceInteractor != null) {
mVoiceInteractor.dump(innerPrefix, fd, writer, args);
}
if (getWindow() != null &&
getWindow().peekDecorView() != null &&
getWindow().peekDecorView().getViewRootImpl() != null) {
getWindow().peekDecorView().getViewRootImpl().dump(prefix, fd, writer, args);
}
mHandler.getLooper().dump(new PrintWriterPrinter(writer), prefix);
}
示例3: dump
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
super.dump(fd, fout, args);
final Printer p = new PrintWriterPrinter(fout);
p.println("LatinIME state :");
p.println(" VersionCode = " + ApplicationUtils.getVersionCode(this));
p.println(" VersionName = " + ApplicationUtils.getVersionName(this));
final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
p.println(" Keyboard mode = " + keyboardMode);
final SettingsValues settingsValues = mSettings.getCurrent();
p.println(settingsValues.dump());
p.println(mDictionaryFacilitator.dump(this /* context */));
// TODO: Dump all settings values
}
示例4: dump
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
super.dump(fd, fout, args);
final Printer p = new PrintWriterPrinter(fout);
p.println("LatinIME state :");
p.println(" Keyboard mode = " + mKeyboardSwitcher.getKeyboardMode());
p.println(" mComposing=" + mComposing.toString());
p.println(" mPredictionOnForMode=" + mPredictionOnForMode);
p.println(" mCorrectionMode=" + mCorrectionMode);
p.println(" mPredicting=" + mPredicting);
p.println(" mAutoCorrectOn=" + mAutoCorrectOn);
p.println(" mAutoSpace=" + mAutoSpace);
p.println(" mCompletionOn=" + mCompletionOn);
p.println(" TextEntryState.state=" + TextEntryState.getState());
p.println(" mSoundOn=" + mSoundOn);
p.println(" mVibrateOn=" + mVibrateOn);
p.println(" mPopupOn=" + mPopupOn);
}
示例5: dump
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
super.dump(fd, fout, args);
final Printer p = new PrintWriterPrinter(fout);
p.println("LatinIME state :");
final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
p.println(" Keyboard mode = " + keyboardMode);
final SettingsValues settingsValues = mSettings.getCurrent();
p.println(" mIsSuggestionsSuggestionsRequested = "
+ settingsValues.isSuggestionsRequested(mDisplayOrientation));
p.println(" mCorrectionEnabled=" + settingsValues.mCorrectionEnabled);
p.println(" isComposingWord=" + mWordComposer.isComposingWord());
p.println(" mSoundOn=" + settingsValues.mSoundOn);
p.println(" mVibrateOn=" + settingsValues.mVibrateOn);
p.println(" mKeyPreviewPopupOn=" + settingsValues.mKeyPreviewPopupOn);
p.println(" inputAttributes=" + settingsValues.mInputAttributes);
}
示例6: dump
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
super.dump(fd, fout, args);
final Printer p = new PrintWriterPrinter(fout);
p.println("LatinIME state :");
p.println(" VersionCode = " + ApplicationUtils.getVersionCode(this));
p.println(" VersionName = " + ApplicationUtils.getVersionName(this));
final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
p.println(" Keyboard mode = " + keyboardMode);
}
示例7: dump
import android.util.PrintWriterPrinter; //导入依赖的package包/类
private void dump(CrashInfo crashInfo) {
try {
File dir = FileUtils.getExternalCacheDir(mContext, String.format(CRASH_LOG_DIR, mContext.getPackageName()));
File file = new File(dir, String.format(CRASH_LOG_FILE_NAME, System.currentTimeMillis()));
OutputStream outputStream = new FileOutputStream(file);
crashInfo.dump(new PrintWriterPrinter(new PrintWriter(outputStream)), "");
} catch (FileNotFoundException ex) {
ex.printStackTrace();
}
}
示例8: onCreate
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Handler handler = new SpeakHandler();
String stringRef1 = new String("Welcome!");
String stringRef2 = new String("Welcome Home!");
Message msg1 = Message.obtain(handler,
SpeakHandler.SAY_WORD,stringRef1);
Message msg2 = Message.obtain(handler,
SpeakHandler.SAY_WORD, stringRef2);
// Enqueue the messages to be processed later
handler.sendMessageDelayed(msg1,600000);
handler.sendMessageDelayed(msg2, 600000);
// try to remove the messages
handler.removeMessages(SpeakHandler.SAY_WORD,
stringRef1);
handler.removeMessages(SpeakHandler.SAY_WORD,
new String("Welcome Home!"));
PrintWriterPrinter out= new PrintWriterPrinter(new PrintWriter(System.out,true));
if ( handler.hasMessages(SpeakHandler.SAY_WORD,stringRef2) ) {
Log.i("RefComparison", "Sorry, we failed to " +
"remove the 'Welcome Home' message!!");
}
handler.getLooper().dump(out,">>> Looper Queue Dump ");
}
开发者ID:PacktPublishing,项目名称:Asynchronous-Android-Programming,代码行数:31,代码来源:CancelMessagesActivity.java
示例9: onCreate
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.handler_example_layout);
TextView console = (TextView)findViewById(R.id.title);
console.setText("Chapter 2 - Multithread Handler");
final WeatherPresenter presHandler = new WeatherPresenter();
HandlerThread handlerThread = new HandlerThread("background",
Process.THREAD_PRIORITY_URGENT_DISPLAY);
handlerThread.start();
final WeatherRetriever retHandler = new WeatherRetriever(
handlerThread.getLooper(),presHandler);
Button todayBut = (Button)findViewById(R.id.todayBut);
todayBut.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
retHandler.sendEmptyMessage(WeatherRetriever.GET_TODAY_FORECAST);
}
});
retHandler.removeCallbacksAndMessages(null);
retHandler.hasMessages(WeatherRetriever.GET_TODAY_FORECAST);
// retHandler.sendEmptyMessage(WeatherRetriever.GET_TODAY_FORECAST);
PrintWriterPrinter out= new PrintWriterPrinter(new PrintWriter(System.out,true));
handlerThread.getLooper().setMessageLogging(out);
}
开发者ID:PacktPublishing,项目名称:Asynchronous-Android-Programming,代码行数:34,代码来源:HandlerExampleActivity.java
示例10: dumpDbInfo
import android.util.PrintWriterPrinter; //导入依赖的package包/类
@Override
public void dumpDbInfo(FileDescriptor fd, String[] args) {
PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd));
PrintWriterPrinter printer = new PrintWriterPrinter(pw);
SQLiteDebug.dump(printer, args);
pw.flush();
}