0

Fairly inexperienced in java still, so I was wondering (as I haven't really found anything useful online) whether there was a way to permanently delete a textview (or any other layout entry, ratingbar etc.) from an android layout in the onclick function.

I want a user to be able to submit a rating only once in every rateable activity, you see.

I have tried everything I can get.

ratingbar.setVisibility(View.GONE);

Works while you're in the activity, yet when you restart again the ratingbar is back. I've also tried:

linearlayout1.removeView( ratingbar );

However, this does the same as

ratingbar.setVisibility(View.GONE);

On reload the ratingbar is back. If anyone can help, that'd be greatly appreciated.

Thanks in advance.

dkgeld
  • 33
  • 1
  • 6

1 Answers1

0

Well you rather choose not to create a view, than deleting a view that's created.

i guess you could create TextView programmatically and decide if you want to attach it to your layout or not in java code.

See : Android: Add a textview to linear layout programmatically

Community
  • 1
  • 1
Commuze
  • 25
  • 5