Back to project page notify.
The source code is released under:
GNU General Public License
If you think the Android project notify listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.notify; //from ww w .ja va2 s. c o m import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; public class FragmentReconnect extends Fragment implements View.OnClickListener { private Boolean died; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_reconnect, container, false); } public FragmentReconnect(Boolean died) { this.died = died; } public void onStart() { super.onStart(); getActivity().findViewById(R.id.reconnect_button).setOnClickListener(this); getActivity().findViewById(R.id.connect_menu_button).setOnClickListener(this); if (this.died) { ((TextView)getActivity().findViewById(R.id.reconnect_text)).setText(R.string.connection_died_text); ((Button)getActivity().findViewById(R.id.reconnect_button)).setText("Reconnect"); } else { ((TextView)getActivity().findViewById(R.id.reconnect_text)).setText(R.string.connection_failed_text); ((Button)getActivity().findViewById(R.id.reconnect_button)).setText("Retry connection"); } } public void onClick(View view) { switch (view.getId()){ case R.id.reconnect_button: MainActivity.ma.startConnection(BackgroundService.host); MainActivity.df.displayConnecting(); break; case R.id.connect_menu_button: MainActivity.df.displayConnect(); break; } } }