1

Android: Can I do alignment when I adding a View?

view story
linux-howto

http://stackoverflow.com – I want to do something like XML attr: android:layout_alignRight="@+id/myView1"> my activity code: button1.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { RelativeLayout ll = (RelativeLayout)findViewById(R.id.aincrad); TextView view = new TextView(Activity.this); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT); layoutParams.addRule(RelativeLayout.ALIGN_R (HowTos)