[Android Studio] liqwde:
Hey ladies and gents,

I'm new to your forums, seems it will be a helpful resource as I undertake this new project. I'm not new to programming, but i'm rusty. About 20 years ago I started with Qbasic, in high school i moved on to Visual Studio and C++. But I have been out of it for awhile now.

I started learning a little python to help my dad with his own program. But Decided I wanted to use Android Studio for my own. I have already started looking into tutorials, but have yet to see some information I am looking for. ( Or just don't recognize due to inexperience )

Traditionally, whats best to use for a multiscreen App? I am currently running windows in Fragments. I have a sidescreen that pops out with a menu button (works), windows slide out with options ( works ), when you select the option the window slides away (works) and it brings up the fragment so you can fill in forms (works.)

Inside my Fragments java file I have this

public class ac extends Fragment {

private EditText od_input;

private EditText sp_input;

private EditText hp_input;

private EditText sl_input;

private EditText hl_input;

private EditText return_input;

private EditText vent_input;

private TextView diag_output;

// TODO: Rename parameter arguments, choose names that match

// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER

private static final String ARG_PARAM1 = "param1";

private static final String ARG_PARAM2 = "param2";

// TODO: Rename and change types of parameters

private String mParam1;

private String mParam2;

private OnFragmentInteractionListener mListener;

public ac() {

// Required empty public constructor

}

/**

* Use this factory method to create a new instance of

* this fragment using the provided parameters.

*

* [MENTION=955119]param[/MENTION] param1 Parameter 1.

* [MENTION=955119]param[/MENTION] param2 Parameter 2.

* [MENTION=2056652]return[/MENTION] A new instance of fragment ac.

*/

// TODO: Rename and change types and number of parameters

public static ac newInstance(String param1, String param2) {

ac fragment = new ac();

Bundle args = new Bundle();

args.putString(ARG_PARAM1, param1);

args.putString(ARG_PARAM2, param2);

fragment.setArguments(args);

return fragment;

}

EditText odtext;

EditText idtext;

EditText sptext;

EditText hptext;

EditText sltext;

EditText hltext;

EditText returntext;

EditText venttext;

[MENTION=439709]override[/MENTION]

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

if (getArguments() != null) {

mParam1 = getArguments().getString(ARG_PARAM1);

mParam2 = getArguments().getString(ARG_PARAM2);

}

}

[MENTION=439709]override[/MENTION]

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_ac, container, false);

// NOTE : We are calling the onFragmentInteraction() declared in the MainActivity

// ie we are sending "Fragment 1" as title parameter when fragment1 is activated

if (mListener != null) {

mListener.onFragmentInteraction("Air Conditioning");

}

// Here we will can create click listners etc for all the gui elements on the fragment.

// For eg: Button btn1= (Button) view.findViewById(R.id.frag1_btn1);

// btn1.setOnclickListener(...

//odtext = view.findViewById(R.id.odtext);

//idtext = (EditText) findViewById(R.id.idtext);

//sptext = view.findViewById(R.id.sptext);

//hptext = view.findViewById(R.id.hptext);

//sltext = view. findViewById(R.id.sltext);

//hltext = view.findViewById(R.id.hltext);

//returntext = view.findViewById(R.id.returntext);

//venttext = view.findViewById(R.id.venttext);

//TextView diagtext = view.findViewById(R.id.diagtext);

//diagtext.setText((CharSequence) odtext);

return view;

}

[MENTION=439709]override[/MENTION]

public void onAttach(Context context) {

super.onAttach(context);

if (context instanceof OnFragmentInteractionListener) {

mListener = (OnFragmentInteractionListener) context;

} else {

throw new RuntimeException(context.toString()

+ " must implement OnFragmentInteractionListener");

}

}

[MENTION=439709]override[/MENTION]

public void onDetach() {

super.onDetach();

mListener = null;

}

/**

* This interface must be implemented by activities that contain this

* fragment to allow an interaction in this fragment to be communicated

* to the activity and potentially other fragments contained in that

* activity.

* <p>

* See the Android Training lesson <a href=

* "http://developer.android.com/training/basics/fragments/communicating.html"

* >Communicating with Other Fragments</a> for more information.

*/

public interface OnFragmentInteractionListener {

// NOTE : We changed the Uri to String.

void onFragmentInteraction(String title);

}

}

Firstly, yes there is a lot of useless crapification going on. Was running different experiments and have not fully cleaned up yet.

But, as people type in the field I want to capture the inputs. Does this require a Listener? Can you capture as they type or do I need a button (Really, Really don't want a button)?

Also, I am unfamiliar with the layout of the java.

Oncreate is when the program boots up?

onCreateview is when the Fragment is booted up?

onattach is when the main activity is associated?

ondetach is when its associated from activity?

I don't fully understand yet where the best place is to add stuff, would it be after onattach?

Thanks for pointing me in the right directions guys.

Chris W. :confused: