0

I have a Fragment within my Activity which is created dynamically from an almost blank layout.xml, which only holds a LinearLayout and a RelativeLayout. Their contents are created at runtime on the user's behalf.

I'd like to synchronize my app widget's layout with the Fragment's, so the app widget will look the same after every change within the Fragment. Those changes are being saved in SharedPreferences, so the Fragment will look the same on next initialization. The reason why I'm using the Fragment is because I want to be able to respond on actions like onLongClick().

So I'm looking for a way to update my app widget's layout with the recently added Views (e.g. a Button).

wodzu
  • 3,004
  • 3
  • 25
  • 41
  • "Their contents are created at runtime on the user's behalf." - You are letting the users create UI elements, right? They have some sort of "palette" of UI elements to choose? – Jose_GD Nov 12 '13 at 22:12
  • Kind of - there is a plus-button, which is supposed to add new buttons to the widget, when clicked. Sorry for the late answer, currently I don't have much time for this project. – wodzu Nov 24 '13 at 17:29
  • No problem, if you don't mind another question before answering yours. "The reason why I'm using the Fragment is because I want to be able to respond on actions like onLongClick()": can't understand this, the reason to use Fragments is to take advantage of a certain gesture like a long press? – Jose_GD Nov 26 '13 at 13:02

0 Answers0