本文整理匯總了Java中android.widget.TextView.removeTextChangedListener方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.removeTextChangedListener方法的具體用法?Java TextView.removeTextChangedListener怎麽用?Java TextView.removeTextChangedListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.TextView
的用法示例。
在下文中一共展示了TextView.removeTextChangedListener方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onItemSelected
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id)
{
// An item was selected. You can retrieve the selected item
// using parent.getItemAtPosition(pos)
// Check id
switch (parent.getId())
{
case R.id.spinner:
String item = (String)parent.getItemAtPosition(pos);
// Get length
length = Integer.parseInt(item);
// Remove the unused slots
if (letters != null)
{
for (int i = 0; i < letters.getChildCount(); i++)
{
TextView text = (TextView)letters.getChildAt(i);
if (i < length)
text.setVisibility(View.VISIBLE);
// Temporarily remove the text change listener to
// stop unexpected consequences
else
{
text.setVisibility(View.GONE);
text.removeTextChangedListener(this);
text.setText("");
text.addTextChangedListener(this);
}
}
}
}
}
示例2: onItemClick
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id)
{
// An item was selected. You can retrieve the selected item
// using parent.getItemAtPosition(pos)
// Check id
switch (parent.getId())
{
case R.id.list:
String word = (String)parent.getItemAtPosition(position);
String s = word.toUpperCase(Locale.getDefault());
// Fill the letters in the slots and temporarily remove
// the text change listener to stop unexpected
// consequences
for (int i = 0; i < length; i++)
{
TextView text = (TextView)letters.getChildAt(i);
text.removeTextChangedListener(this);
text.setText(s.substring(i, i + 1));
text.addTextChangedListener(this);
}
// Start the web search
Intent intent = new Intent(this, SearchActivity.class);
intent.putExtra(WORD, word);
startActivity(intent);
}
}
示例3: doClear
import android.widget.TextView; //導入方法依賴的package包/類
private void doClear()
{
// Temporarily remove the text change listener to stop
// unexpected consequences
for (int i = 0; i < length; i++)
{
TextView text = (TextView)letters.getChildAt(i);
text.removeTextChangedListener(this);
text.setText("");
text.addTextChangedListener(this);
}
}
示例4: removeTextWatcher
import android.widget.TextView; //導入方法依賴的package包/類
private static void removeTextWatcher(TextView textView) {
textView.removeTextChangedListener(
(TextWatcher) textView.getTag(R.id.onTextChangedListener)
);
textView.setTag(R.id.onTextChangedListener, null);
}