0
我試圖在我的片段的創建視圖方法中啓動選擇器。我不能啓動地方選擇器
int PLACE_PICKER_REQUEST = 1;
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
除了「中的最後一行這個)突出紅色,並指出」建設意圖製造商的Android context.Context不能應用到碎片「
有誰知道我需要改變爲此在一個片段內工作?感謝
更換
this
更換'this'用'getActivity()'如果? 'build()'方法需要一個'Activity'而不是'Fragment'。 –