I’m trying set a layout for textview so I can use getEllipsisCount() method. But below code returns null as layout value.
How can I take layout and
First, I do not know if it is a typo or it is intentional but you have declared a "settext" method instead of the predefined setText. However to get a reference of your layout I suggest you the following:
LayoutInflater inflater = getLayoutInflater();
RelativeLayout textViewLayout = (RelativeLayout) inflater.inflate(R.layout.activity_main,null);
if (textViewLayout != null) {
mytextview.setText("very good layout worked\n");
}
supposing that your TextView belongs to a RelativeLayout.