¡@

Home 

2014/10/16 ¤W¤È 08:19:48

android Programming Glossary: mtext

Remove Fragment Page from ViewPager in Android

http://stackoverflow.com/questions/10396321/remove-fragment-page-from-viewpager-in-android

public class MyFragment extends Fragment private String mText public static MyFragment newInstance String text MyFragment.. f public MyFragment public MyFragment String text this.mText text @Override public View onCreateView LayoutInflater inflater.. false TextView root.findViewById R.id.position .setText mText return root activity_main.xml xml version 1.0 encoding utf..

Android long-touch event

http://stackoverflow.com/questions/3553163/android-long-touch-event

mIncButton private Button mDecButton private TextView mText private int mCounter private Handler mHandler private ScheduledExecutorService.. mDecButton Button findViewById R.id.dec_button mText TextView findViewById R.id.text mIncButton.setOnTouchListener.. this private void inc mCounter mText.setText Integer.toString mCounter private void dec mCounter..

create toast from IntentService

http://stackoverflow.com/questions/3955410/create-toast-from-intentservice

private class DisplayToast implements Runnable String mText public DisplayToast String text mText text public void run Toast.makeText.. Runnable String mText public DisplayToast String text mText text public void run Toast.makeText mContext mText Toast.LENGTH_SHORT.. text mText text public void run Toast.makeText mContext mText Toast.LENGTH_SHORT .show protected void onHandleIntent Intent..

Is there a way to use the SpeechRecognizer API directly for speech input?

http://stackoverflow.com/questions/4975443/is-there-a-way-to-use-the-speechrecognizer-api-directly-for-speech-input

Activity implements OnClickListener private TextView mText private SpeechRecognizer sr private static final String TAG.. Button speakButton Button findViewById R.id.btn_speak mText TextView findViewById R.id.textView1 speakButton.setOnClickListener.. public void onError int error Log.d TAG error error mText.setText error error public void onResults Bundle results ..

How can I use speech recognition without the annoying dialog in android phones

http://stackoverflow.com/questions/6316937/how-can-i-use-speech-recognition-without-the-annoying-dialog-in-android-phones

Activity implements OnClickListener private TextView mText private SpeechRecognizer sr private static final String TAG.. Button speakButton Button findViewById R.id.btn_speak mText TextView findViewById R.id.textView1 speakButton.setOnClickListener.. public void onError int error Log.d TAG error error mText.setText error error public void onResults Bundle results ..

Voice Recognition as a background service

http://stackoverflow.com/questions/6372080/voice-recognition-as-a-background-service

Activity implements OnClickListener private TextView mText private SpeechRecognizer sr private static final String TAG.. Button speakButton Button findViewById R.id.btn_speak mText TextView findViewById R.id.textView1 speakButton.setOnClickListener.. public void onError int error Log.d TAG error error mText.setText error error public void onResults Bundle results ..

Android character by character display text animation

http://stackoverflow.com/questions/6700374/android-character-by-character-display-text-animation

class Typewriter extends TextView private CharSequence mText private int mIndex private long mDelay 500 Default 500ms delay.. new Runnable @Override public void run setText mText.subSequence 0 mIndex if mIndex mText.length mHandler.postDelayed.. void run setText mText.subSequence 0 mIndex if mIndex mText.length mHandler.postDelayed characterAdder mDelay public..

Android ICMP ping

http://stackoverflow.com/questions/9062182/android-icmp-ping

mPIn LineNumberReader mReader Process mProcess TextView mText TextView findViewById R.id.text @Override protected void onPreExecute.. the output you should typically parse it I guess. mText.setText mReader.readLine catch IOException t share improve..

Remove Fragment Page from ViewPager in Android

http://stackoverflow.com/questions/10396321/remove-fragment-page-from-viewpager-in-android

int position public int getCount MyFragment.java public class MyFragment extends Fragment private String mText public static MyFragment newInstance String text MyFragment f new MyFragment text return f public MyFragment public MyFragment.. String text MyFragment f new MyFragment text return f public MyFragment public MyFragment String text this.mText text @Override public View onCreateView LayoutInflater inflater ViewGroup container Bundle savedInstanceState View root.. View root inflater.inflate R.layout.fragment container false TextView root.findViewById R.id.position .setText mText return root activity_main.xml xml version 1.0 encoding utf 8 LinearLayout xmlns android http schemas.android.com apk res..

Android long-touch event

http://stackoverflow.com/questions/3553163/android-long-touch-event

int MSG_INC 0 private static final int MSG_DEC 1 private Button mIncButton private Button mDecButton private TextView mText private int mCounter private Handler mHandler private ScheduledExecutorService mUpdater Called when the activity is first.. msg mIncButton Button findViewById R.id.inc_button mDecButton Button findViewById R.id.dec_button mText TextView findViewById R.id.text mIncButton.setOnTouchListener this mIncButton.setOnKeyListener this mIncButton.setOnClickListener.. this mDecButton.setOnKeyListener this mDecButton.setOnClickListener this private void inc mCounter mText.setText Integer.toString mCounter private void dec mCounter mText.setText Integer.toString mCounter private void startUpdating..

create toast from IntentService

http://stackoverflow.com/questions/3955410/create-toast-from-intentservice

initialize a Handler and then post to it from your thread. private class DisplayToast implements Runnable String mText public DisplayToast String text mText text public void run Toast.makeText mContext mText Toast.LENGTH_SHORT .show protected.. to it from your thread. private class DisplayToast implements Runnable String mText public DisplayToast String text mText text public void run Toast.makeText mContext mText Toast.LENGTH_SHORT .show protected void onHandleIntent Intent intent.. implements Runnable String mText public DisplayToast String text mText text public void run Toast.makeText mContext mText Toast.LENGTH_SHORT .show protected void onHandleIntent Intent intent ... mHandler.post new DisplayToast did something ..

Is there a way to use the SpeechRecognizer API directly for speech input?

http://stackoverflow.com/questions/4975443/is-there-a-way-to-use-the-speechrecognizer-api-directly-for-speech-input

import android.util.Log public class VoiceRecognitionTest extends Activity implements OnClickListener private TextView mText private SpeechRecognizer sr private static final String TAG MyStt3Activity @Override public void onCreate Bundle savedInstanceState.. super.onCreate savedInstanceState setContentView R.layout.main Button speakButton Button findViewById R.id.btn_speak mText TextView findViewById R.id.textView1 speakButton.setOnClickListener this sr SpeechRecognizer.createSpeechRecognizer this.. public void onEndOfSpeech Log.d TAG onEndofSpeech public void onError int error Log.d TAG error error mText.setText error error public void onResults Bundle results String str new String Log.d TAG onResults results ArrayList..

How can I use speech recognition without the annoying dialog in android phones

http://stackoverflow.com/questions/6316937/how-can-i-use-speech-recognition-without-the-annoying-dialog-in-android-phones

import android.util.Log public class voiceRecognitionTest extends Activity implements OnClickListener private TextView mText private SpeechRecognizer sr private static final String TAG MyStt3Activity @Override public void onCreate Bundle savedInstanceState.. super.onCreate savedInstanceState setContentView R.layout.main Button speakButton Button findViewById R.id.btn_speak mText TextView findViewById R.id.textView1 speakButton.setOnClickListener this sr SpeechRecognizer.createSpeechRecognizer this.. public void onEndOfSpeech Log.d TAG onEndofSpeech public void onError int error Log.d TAG error error mText.setText error error public void onResults Bundle results String str new String Log.d TAG onResults results ArrayList..

Voice Recognition as a background service

http://stackoverflow.com/questions/6372080/voice-recognition-as-a-background-service

import android.util.Log public class voiceRecognitionTest extends Activity implements OnClickListener private TextView mText private SpeechRecognizer sr private static final String TAG MyStt3Activity @Override public void onCreate Bundle savedInstanceState.. super.onCreate savedInstanceState setContentView R.layout.main Button speakButton Button findViewById R.id.btn_speak mText TextView findViewById R.id.textView1 speakButton.setOnClickListener this sr SpeechRecognizer.createSpeechRecognizer this.. public void onEndOfSpeech Log.d TAG onEndofSpeech public void onError int error Log.d TAG error error mText.setText error error public void onResults Bundle results String str new String Log.d TAG onResults results ArrayList..

Android character by character display text animation

http://stackoverflow.com/questions/6700374/android-character-by-character-display-text-animation

every so often until the complete sequence is displayed public class Typewriter extends TextView private CharSequence mText private int mIndex private long mDelay 500 Default 500ms delay public Typewriter Context context super context public Typewriter.. private Handler mHandler new Handler private Runnable characterAdder new Runnable @Override public void run setText mText.subSequence 0 mIndex if mIndex mText.length mHandler.postDelayed characterAdder mDelay public void animateText CharSequence.. private Runnable characterAdder new Runnable @Override public void run setText mText.subSequence 0 mIndex if mIndex mText.length mHandler.postDelayed characterAdder mDelay public void animateText CharSequence text mText text mIndex 0 setText..

Android ICMP ping

http://stackoverflow.com/questions/9062182/android-icmp-ping

String Void Void PipedOutputStream mPOut PipedInputStream mPIn LineNumberReader mReader Process mProcess TextView mText TextView findViewById R.id.text @Override protected void onPreExecute mPOut new PipedOutputStream try mPIn new PipedInputStream..