本文整理了Java中android.view.View.toString()
方法的一些代码示例,展示了View.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.toString()
方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:toString
暂无
代码示例来源:origin: facebook/litho
private String getViewString(View view) {
String string = view.toString();
return removePrefix(removePrefix(string, "android.widget."), "android.view.");
}
代码示例来源:origin: stackoverflow.com
Log.d("menfis", child.toString());
if(child.getClass() == TextView.class)
代码示例来源:origin: facebook/litho
private String getString(final View view) {
return removePrefix(
removePrefix(view.toString(), "android.widget."),
"android.view.");
}
代码示例来源:origin: facebook/stetho
if (e instanceof IllegalAccessException || e instanceof InvocationTargetException) {
LogUtil.e(e, "failed to get style property " + property.getCSSName() +
" of element= " + element.toString());
} else {
throw ExceptionUtil.propagate(e);
代码示例来源:origin: stackoverflow.com
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
float x = event.getX();
float y = event.getY();
Log.v("ON_TOUCH", "Action = " + action + " View:" + v.toString());
Log.v("ON_TOUCH", "X = " + x + "Y = " + y);
return false;
代码示例来源:origin: stackoverflow.com
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String text = v.toString();
// do something with the text.
}
});
代码示例来源:origin: qiubiteme/android_api_demos
@Override
public String toString() {
if (mLabel != null) {
return mLabel;
}
return super.toString();
}
}
代码示例来源:origin: stackoverflow.com
RelativeLayout rl = (RelativeLayout) findViewById(R.id.myLayout);
rl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d("patricia", view.toString());
}
});
代码示例来源:origin: stackoverflow.com
holder.checkBox.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Log.d(TAG, arg0.toString());
Log.v(TAG, "FROM " + mprojects.isCheck() + " TO " + !mprojects.isCheck() );
mprojects.setCheck(!mprojects.isCheck());
Log.d(TAG, "Project " + mprojects.getId());
saveSpinnerData(inflater.getContext() , mprojects);
}
});
代码示例来源:origin: stackoverflow.com
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
View viewer=getView();
if(viewer==null){
Itu.showToast("null",getActivity(), Toast.LENGTH_LONG);
}else{
Itu.showToast(viewer.toString(),getActivity(), Toast.LENGTH_LONG);//This is called
}
}
代码示例来源:origin: THEONE10211024/ApiDemos
@Override
public String toString() {
if (mLabel != null) {
return mLabel;
}
return super.toString();
}
}
代码示例来源:origin: stackoverflow.com
public static Matcher<View> toMatcher(final View v) {
return new TypeSafeMatcher<View>() {
@Override
protected boolean matchesSafely(View item) {
return item == v;
}
@Override
public void describeTo(Description description) {
description.appendText(v.toString());
}
};
}
代码示例来源:origin: stackoverflow.com
public void onClick(View v) {
Log.i("whaaat", v.toString());
Log.i("whaaat", "hello");
Toast.makeText(getApplicationContext(), "1", Toast.LENGTH_LONG)
.show();
if(v.getId()==R.id.selectMaleAvtr) {
Log.i("UserOnboardActivity", "male avatar button pressed");
} else if (v.getId()==R.id.selectFemaleAvtr) {
Log.i("UserOnboardActivity", "female avatar button pressed");
}
}
代码示例来源:origin: gdutxiaoxu/CoordinatorLayoutExample
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "点击我了", Toast.LENGTH_SHORT).show();
Log.i(TAG, "onClick: v=" +v.toString());
}
});
代码示例来源:origin: stackoverflow.com
View rowView = convertView;
if (rowView == null) {
LayoutInflater inflater = context.getLayoutInflater();
rowView = inflater.inflate(R.layout.mod_req_list, null);
}
deleteButton = (Button) rowView.findViewById(R.id.icon);
deleteButton.setTag(position);
TextView textView = (TextView) rowView.findViewById(R.id.rowId);
textView.setText(names[position]);
Log.d("views", rowView.toString());
return rowView;
代码示例来源:origin: hsllany/HtmlNative
@Override
public LuaValue call() {
if (mCreated) {
return LView.valueOf(mView.toString());
} else {
return LuaValue.NIL;
}
}
});
代码示例来源:origin: jbruchanov/AnUitor
@Override
public String[] getViewRootNames() {
View[] mViews = getRootViews();
String[] mRoots = new String[mViews.length];
for (int i = 0; i < mRoots.length; i++) {
mRoots[i] = mViews[i].toString();
}
return mRoots;
}
代码示例来源:origin: jbruchanov/AnUitor
@Override
public View getRootView(String rootName) {
View[] mViews = getRootViews();
for (int i = 0; i < mViews.length; i++) {
if (rootName.equals(mViews[i].toString())) {
return mViews[i];
}
}
return null;
}
代码示例来源:origin: THEONE10211024/ApiDemos
public boolean onLongClick(View v) {
ClipData data = ClipData.newPlainText("dot", "Dot : " + v.toString());
v.startDrag(data, new ANRShadowBuilder(v, mAnrType == ANR_SHADOW),
(Object)v, 0);
return true;
}
});
代码示例来源:origin: appium/appium-espresso-driver
@Override
public void describeTo(Description description) {
description.appendText(String.format("Looked for element with View %s", view.toString()));
}
};
内容来源于网络,如有侵权,请联系作者删除!