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 www. j a va2 s.c o m import android.app.Fragment; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; public class FragmentManual extends Fragment implements View.OnClickListener { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_manual, container, false); } public void onStart() { super.onStart(); getActivity().findViewById(R.id.manual_button).setOnClickListener(this); } public void onClick(View view) { if (view.getId() == R.id.manual_button) { InputMethodManager imm = (InputMethodManager)MainActivity.ma.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(MainActivity.ma.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); String text = ((EditText)getActivity().findViewById(R.id.manual_edittext)).getText().toString().toLowerCase(); if (text == "") { return; } text = text.replaceAll("c", "192.168."); text = text.replaceAll("b", "172."); text = text.replaceAll("a", "10."); text = text.replaceAll("d", "."); text = text.replaceAll("\\.\\.", ".0."); text = "notify://" + text + ":18081"; MainActivity.df.displayConnecting(); MainActivity.ma.startConnection(Uri.parse(text)); } } }