-1
你好,我有一個問題,當我搜索的頁面明天的過程是成功的,但是當我今天搜索頁面上,有一個問題,我用片段搜索框不響應
問題就在這裏:https://www.youtube.com/watch?v=FiHGME6i97I&feature=youtu.be
代碼:
public void btn_search(View view) {
TextView txtexample = (TextView)findViewById(R.id.txtexample);
txtexample.setText("hello");
}
片段天
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.user.weather.Fragment_days">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/txtexample"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
片段天
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_days, container, false);
return v;
}
和片段今天和明天是空的。
請幫幫我,兩個星期前,我一直在尋找一個問題
不工作:( –
今天或10天搜索頁面時,退出程序 –
它顯然會因爲你在第一個片段而崩潰,並且你正在更改在onresume()方法中休息的搜索按鈕單擊最後一個片段的視圖 –