TextView balloon = new TextView(this);
   
balloon.setText(text);
balloon.setBackgroundResource(R.drawable.text_green_back);
balloon.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
balloon.setPadding(10, 10, 20, 10);
balloon.setTextColor(Color.BLACK);
balloon.setTextSize(15);
balloon.setGravity(Gravity.RIGHT);
qnaLayout.addView(balloon);


위와 같이 프로그래밍을 했는데 Gravity 설정이 먹지 않습니다.

레이아웃에서 오른쪽 정렬을 시키고 싶은데 왼쪽에 나오네요.

잘 못된 부분이 있나요?