Back to project page LyricHere.
The source code is released under:
Apache License
If you think the Android project LyricHere 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 cn.zhaiyifan.lyrichere.ui; /*from ww w .ja v a 2s . co m*/ import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import cn.zhaiyifan.lyrichere.R; public class DownloadFragment extends Fragment { private static final String TAG = DownloadFragment.class.getSimpleName(); private OnFragmentInteractionListener mListener; public DownloadFragment() { // Required empty public constructor } public static DownloadFragment newInstance() { DownloadFragment fragment = new DownloadFragment(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_download, container, false); Button submitButton = (Button) view.findViewById(R.id.submit_button); Button clearButton = (Button) view.findViewById(R.id.clear_button); submitButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onButtonPressed(getActivity().getString(R.string.not_implemented)); } }); clearButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onButtonPressed(getActivity().getString(R.string.not_implemented)); } }); return view; } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(String hint) { if (mListener != null) { mListener.onFragmentInteraction(hint); } } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } public interface OnFragmentInteractionListener { public void onFragmentInteraction(String hint); } }