@Override protected void blockComplete(final BaseDownloadTask task) { downloadMsgTv.post(new Runnable() { @Override public void run() { updateDisplay(String.format("[blockComplete] id[%d]", task.getId())); } }); }
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")); } }
@Override public void OnNetDiagnoUpdated(String log) { resultTextView.post(new updateResultRunnable(log)); } }
@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")); } } };
@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; }
@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(); } } } };
@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); } }
@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")); } } };
@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")); } };
mTv.post(new Runnable() { @Override public void run() {
mTvContent.post(new Runnable() { @Override public void run() {
@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); }
@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
@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
@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
currentScore.post( new Runnable() { @Override
public static void appendText(TextView textView, String text){ textView.post(new Runnable() { @Override public void run() { textView.setText(textView.getText()+"\n"+text); } }); } }
@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 }
@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); } }); } }
@Override public void run() { final TextView titleTextView = mAdapter.getTitleTextView(); titleTextView.post(new Runnable() { @Override public void run() { mTitleHeight = titleTextView.getHeight(); } }); } });