You need to inflate the layout you want to show in the popup. findViewById()
only returns views, that already have been inflated.
Try this:
final PopupWindow popUp = new PopupWindow(context);
LayoutInflater inflater = LayoutInflater.from(this);
final LinearLayout ll =
(LinearLayout)inflater.inflate(R.layout.settings_caching_popup, null);
popUp.setContentView(ll);
ll.post(new Runnable() {
public void run() {
popUp.showAtLocation(ll, Gravity.BOTTOM, 10, 10);
popUp.update(50, 50, 300, 80);
}
});
Notice, that this
in LayoutInflater.from(this);
has to be your activity. So, if you want to call this from an OnClickListener
or something similar, you need to put YourActivity.this
there.