本文整理了Java中android.widget.TextView.post()
方法的一些代码示例,展示了TextView.post()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.post()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:post
暂无
代码示例来源:origin: lingochamp/FileDownloader
@Override
protected void blockComplete(final BaseDownloadTask task) {
downloadMsgTv.post(new Runnable() {
@Override
public void run() {
updateDisplay(String.format("[blockComplete] id[%d]", task.getId()));
}
});
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
public void setResult(String result){
Pattern pattern = Pattern.compile("(?<=rom )[\\w\\W]+(?=\\n\\n)");
Matcher matcher = pattern.matcher(result);
if(matcher.find()){
resultTextView.post(new updateResultRunnable(matcher.group(0) + "\n"));
}
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
@Override
public void OnNetDiagnoUpdated(String log) {
resultTextView.post(new updateResultRunnable(log));
}
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
@Override
public void run() {
StringBuilder sb = new StringBuilder();
try{
InetAddress aaa = InetAddress.getByName(url);
InetAddress[] addrs = InetAddress.getAllByName(url);
sb.append("Begin: \n" + aaa.toString() + "\nEnd\n");
for (InetAddress adr : addrs)
{
sb.append(adr.toString() + "\n");
resultTextView.post(new updateResultRunnable(adr.toString() + "\n"));
}
}
catch (Exception e){
resultTextView.post(new updateResultRunnable(e.toString() + "\n"));
}
}
};
代码示例来源:origin: stackoverflow.com
@Override
public View getDropDownView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = new TextView(_context);
}
TextView item = (TextView) convertView;
item.setText("asddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd");
final TextView finalItem = item;
item.post(new Runnable() {
@Override
public void run() {
finalItem.setSingleLine(false);
}
});
return item;
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
@Override
public void run() {
BufferedReader in = null;
Runtime rt = Runtime.getRuntime();
boolean FoundMatch = false;
String pingCommand = "/system/bin/ping -c 10 " + url;
Log.e("TAG", "ping thread is running");
try {
Process pro = rt.exec(pingCommand);
in = new BufferedReader(new InputStreamReader(pro.getInputStream()));
final StringBuilder sb = new StringBuilder();
String line = in.readLine();
while (line != null) {
sb.append(line + "\n");
resultTextView.post(new updateResultRunnable(line + "\n"));
line = in.readLine();
}
} catch (IOException e) {
resultTextView.post(new updateResultRunnable(e.toString() + "\n"));
} finally {
try{
if (in != null) {
in.close();
}
}catch (Exception e){
e.printStackTrace();
}
}
}
};
代码示例来源:origin: Rukey7/MvpApp
@Override
public void onResume() {
super.onResume();
if (mLovedAnimator == null) {
mIvCount.post(new Runnable() {
@Override
public void run() {
mLovedAnimator = AnimateHelper.doHappyJump(mIvCount, mIvCount.getHeight() * 2/3, 3000);
}
});
} else {
AnimateHelper.startAnimator(mLovedAnimator);
}
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
@Override
public void run() {
try{
int permissionCheck = ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE);
if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(context, new String[]{Manifest.permission.READ_PHONE_STATE}, 1);
} else {
// TraceRouteWithPing traceRouteWithPing = new TraceRouteWithPing(url, TraceTask.this);
// traceRouteWithPing.executeTraceRoute();
LDNetDiagnoService _netDiagnoService = new LDNetDiagnoService(context.getApplicationContext(),
"NetworkDiagnosis", "网络诊断应用", DeviceUtils.getVersion(context), "",
"", url, "", "",
"", "", TraceTask.this);
// 设置是否使用JNIC 完成traceroute
_netDiagnoService.setIfUseJNICTrace(true);
_netDiagnoService.execute();
}
}
catch (Exception e){
resultTextView.post(new updateResultRunnable(e.toString() + "\n"));
}
}
};
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
@Override
public void run() {
NetBasicInfo mNetBasicInfo = NetBasicInfo.getInstance(resultTextView.getContext());
resultTextView.post(new updateResultRunnable(mNetBasicInfo.getApnInfo()
+ "\r\nMac address : \r\n"
+ "wlan0 :\t" + mNetBasicInfo.getMacAddress("wlan0")
+ "\np2p0 :\t " + mNetBasicInfo.getMacAddress("p2p0")
+ "\n\n" + SystemBasicInfo.getBuildInfo()
+ "\n"));
}
};
代码示例来源:origin: Manabu-GT/ExpandableTextView
mTv.post(new Runnable() {
@Override
public void run() {
代码示例来源:origin: jaydenxiao2016/AndroidFire
mTvContent.post(new Runnable() {
@Override
public void run() {
代码示例来源:origin: hidroh/materialistic
@CallSuper
protected void bind(final VH holder, final Item item) {
if (item == null) {
return;
}
highlightUserItem(holder, item);
decorateDead(holder, item);
holder.mContentTextView.setLineSpacing(0f, mLineHeight);
AppUtils.setTextWithLinks(holder.mContentTextView, item.getDisplayedText());
Integer lineCount = mLineCounted.get(item.getId());
if (lineCount != null && lineCount > 0) {
toggleCollapsibleContent(holder, item, lineCount);
} else {
holder.mContentTextView.post(() -> {
if (mContext == null) {
return;
}
int count = holder.mContentTextView.getLineCount();
mLineCounted.put(item.getId(), count);
toggleCollapsibleContent(holder, item, count);
});
}
bindActions(holder, item);
}
代码示例来源:origin: chrisk44/Hijacker
@Override
public void onResume() {
super.onResume();
currentFragment = FRAGMENT_REAVER;
refreshDrawer();
//Console text is saved/restored on pause/resume
consoleView.setText(console_text);
consoleView.post(new Runnable() {
@Override
public void run() {
consoleScrollView.fullScroll(View.FOCUS_DOWN);
}
});
}
@Override
代码示例来源:origin: chrisk44/Hijacker
@Override
public void onResume(){
super.onResume();
currentFragment = FRAGMENT_CUSTOM;
refreshDrawer();
//Console text is saved/restored on pause/resume
consoleView.setText(console_text);
consoleView.post(new Runnable() {
@Override
public void run() {
consoleScrollView.fullScroll(View.FOCUS_DOWN);
}
});
}
@Override
代码示例来源:origin: chrisk44/Hijacker
@Override
public void onResume() {
super.onResume();
currentFragment = FRAGMENT_CRACK;
refreshDrawer();
//Console text is saved/restored on pause/resume
consoleView.setText(console_text);
consoleView.post(new Runnable() {
@Override
public void run() {
consoleScrollView.fullScroll(View.FOCUS_DOWN);
}
});
}
@Override
代码示例来源:origin: google/santa-tracker-android
currentScore.post(
new Runnable() {
@Override
代码示例来源:origin: florent37/RuntimePermission
public static void appendText(TextView textView, String text){
textView.post(new Runnable() {
@Override
public void run() {
textView.setText(textView.getText()+"\n"+text);
}
});
}
}
代码示例来源:origin: doo/scanbot-sdk-example-android
@Override
public boolean handleResult(final ContourDetectorFrameHandler.DetectedFrame detectedFrame) {
// Here you are continuously notified about contour detection results.
// For example, you can show a user guidance text depending on the current detection status.
userGuidanceHint.post(new Runnable() {
@Override
public void run() {
showUserGuidance(detectedFrame.detectionResult);
}
});
return false; // typically you need to return false
}
代码示例来源:origin: MicrosoftTranslator/Local-Feature-Android
@Override
protected void onProgressUpdate(String... progress) {
if (progress != null) {
final String msg = progress[0];
logView.post(new Runnable() {
@Override
public void run() {
logView.append(msg);
}
});
}
}
代码示例来源:origin: smuyyh/SprintNBA
@Override
public void run() {
final TextView titleTextView = mAdapter.getTitleTextView();
titleTextView.post(new Runnable() {
@Override
public void run() {
mTitleHeight = titleTextView.getHeight();
}
});
}
});
内容来源于网络,如有侵权,请联系作者删除!