Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have wrongly initialized your <code>TextView</code> As you have added <code>TextView</code> in your layout and you are trying to initialize it with <code>LinearLayout</code> which is wrong.</p> <p>Change the <code>LinearLayout</code> with <code>TextView</code> in your onCreate() as below :</p> <pre><code> someLayout = (TextView) findViewById(R.id.state2); </code></pre> <p>Why are you inflating your layout two times in your code ? I do not understand why are you doing so. But i am providing the code with some relevant code try with my code. </p> <pre><code>public class MainActivity extends Activity { private LayoutInflater inflater; private TextView someLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); someLayout = (TextView) findViewById(R.id.state2); //layout present in activity_main // inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE); runNextTask(); } public void runNextTask(){ // LinearLayout mInflatedLayout = (LinearLayout) inflater.inflate(R.layout.activity_main, null); @SuppressWarnings("unused") final TrackerInfo newInfo = new TrackerInfo(); //set up for model selection // TextView modelTextview = (TextView)mInflatedLayout.findViewById(R.id.state2); //someLayout.addView(mInflatedLayout); someLayout.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); } </code></pre> <p>FYI You can not add any layout in <code>TextView</code> as its <code>View</code> not a <code>Layout</code> and in your code i have seen that you are trying to add <code>Layout</code> into <code>View</code> which is wrong. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload