第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Fragment中點擊事件跳轉活動報錯

Fragment中點擊事件跳轉活動報錯

富國滬深 2018-07-31 11:14:34
本來想實現(xiàn)點擊“售后服務”這一塊的Linearlayout跳轉到Guarantee這個活動當中這一功能public class ThirdFragment extends Fragment implements View.OnClickListener{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.third_fragment, container, false); LinearLayout guaranteell = (LinearLayout) view.findViewById(R.id.serviceGuaranteeId); guaranteell.setOnClickListener(this); return view; } @Override public void onClick(View view){ MainActivity mainActivity = new MainActivity(); Intent intent = new Intent(mainActivity, Guarantee.class); startActivity(intent); //Toast.makeText(mainActivity, "you clicked this", Toast.LENGTH_SHORT).show(); } }但是報錯java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 689 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號