,他們給你的一個片段類的代碼如下片段類,但我越來越
ExampleFragments.java
package com.example.learn.fragments;
public static class ExampleFragments extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.blue_pill_frag, container, false);
}
}
但我得到了第9行的錯誤,我在那裏聲明類的名稱。
Illegal modifier for the class ExampleFragments; only public, abstract & final are permitted
我敢肯定,這是基本的東西是我不理解,謝謝。
好吧,所以我需要去了解什麼是靜態類。謝謝。另一個問題,但。爲什麼谷歌給一個'靜態類'作爲例子?我應該使用片段作爲靜態還是無關緊要? – EGHDK 2012-07-23 14:03:27
這可能是因爲它是* inner *類。 – aioobe 2012-07-23 14:09:24