I am having this error android.widget.LinearLayout$LayoutParams.
When using this code.
public void modifyingTextViews(){//This sets up a margin for the textviews.
LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
llp.setMargins(0, 30, 0, 30);
textview1.setLayoutParams(llp);
textview2.setLayoutParams(llp);
}
It conflicts with my touch methods or my load methods which consists of view flipper with 2 textview and a loader.
From what I understand from a guy with a similar issue is that it is because I am getting this error probably because of the arrangement of the view.
Now My question is how would I be able to tell which is my main view on a view flipper if I have different xmls. Also if there would be a quick fix to the problem that would be appreciated as well.
I can’t tell what the issue is without knowing more (your xml code would be a start). Since you asked for an easy fix… I would just define everything in XML. That way everything is organized and you don’t have to worry about setting
LayoutParamsat runtime.Of course, this is a hypothetical example and you’ll have to write the XML code to get the layout you want, but hopefully this gives you a good idea of where to start. Once you get it all set up, initializing the layout is simply a matter of calling
setContentView()in youronCreate()method.