2

I tried to import the following:

import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout.LayoutParams;

But it says a type named LayoutParams has already been imported.

Charles Spencer
  • 626
  • 1
  • 6
  • 17
NaHim
  • 181
  • 1
  • 1
  • 7
  • Wrongly marked as duplicate. Checked the link all the answers are python related. – Abhijit Pritam Dutta Mar 06 '18 at 22:51
  • One solution that I'm not sure is mentioned in the duplicate link is to use `import android.widget.LinearLayout` and `import android.widget.RelativeLayout`, and then in your code, you can do `LinearLayout.LayoutParams params1` and `RelativeLayout.LayoutParams params2`. This is a unique case because these are both nested classes – Charles Spencer Mar 06 '18 at 22:54
  • android.widget.LinearLayout.LayoutParams layout = new Use the reference directly in the code like android.widget.LinearLayout.LayoutParams(); android.widget.RelativeLayout.LayoutParams layoutprm = new android.widget.RelativeLayout.LayoutParams() – Abhijit Pritam Dutta Mar 06 '18 at 22:55
  • 1
    @AbhijitPritam you're wrong, the person who is asking just used a python code as an example for comparison, but everything is about java, even the question itself – Gustavo Topete Mar 06 '18 at 23:25

0 Answers0