| 21478 |
rajender |
1 |
package com.saholic.profittill.main;
|
|
|
2 |
|
|
|
3 |
import android.app.Fragment;
|
|
|
4 |
import android.content.Context;
|
|
|
5 |
import android.content.Intent;
|
|
|
6 |
import android.content.SharedPreferences;
|
|
|
7 |
import android.os.Bundle;
|
|
|
8 |
import android.view.KeyEvent;
|
|
|
9 |
import android.view.LayoutInflater;
|
|
|
10 |
import android.view.View;
|
|
|
11 |
import android.view.ViewGroup;
|
|
|
12 |
|
|
|
13 |
import com.saholic.profittill.R;
|
|
|
14 |
import com.testin.agent.TestinAgent;
|
|
|
15 |
|
|
|
16 |
public class ContactUsFragment extends Fragment {
|
|
|
17 |
|
|
|
18 |
SharedPreferences userData;
|
|
|
19 |
SharedPreferences apiData;
|
|
|
20 |
SharedPreferences.Editor userDataEditor;
|
|
|
21 |
SharedPreferences.Editor apiSettingsEditor;
|
|
|
22 |
|
|
|
23 |
@Override
|
|
|
24 |
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
25 |
Bundle savedInstanceState) {
|
|
|
26 |
|
|
|
27 |
View rootView = inflater.inflate(R.layout.fragment_contact_us, container, false);
|
|
|
28 |
TestinAgent.init(getActivity());
|
|
|
29 |
userData = getActivity().getSharedPreferences("User_Data", Context.MODE_PRIVATE);
|
|
|
30 |
apiData = getActivity().getSharedPreferences("API_Data", Context.MODE_PRIVATE);
|
|
|
31 |
userDataEditor = userData.edit();
|
|
|
32 |
apiSettingsEditor = apiData.edit();
|
|
|
33 |
TestinAgent.setUserInfo(userData.getString("id",""));
|
|
|
34 |
|
|
|
35 |
return rootView;
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
@Override
|
|
|
39 |
public void onResume() {
|
|
|
40 |
super.onResume();
|
|
|
41 |
getView().setFocusableInTouchMode(true);
|
|
|
42 |
getView().requestFocus();
|
|
|
43 |
getView().setOnKeyListener(new View.OnKeyListener() {
|
|
|
44 |
@Override
|
|
|
45 |
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
|
|
46 |
|
|
|
47 |
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK){
|
|
|
48 |
Intent i = new Intent(getActivity(), MainActivity.class);
|
|
|
49 |
i.putExtra("displayView", "0");
|
|
|
50 |
startActivity(i);
|
|
|
51 |
return true;
|
|
|
52 |
}
|
|
|
53 |
return false;
|
|
|
54 |
}
|
|
|
55 |
});
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
@Override
|
|
|
59 |
public void onViewCreated(View view, Bundle savedInstanceState) {
|
|
|
60 |
|
|
|
61 |
super.onViewCreated(view, savedInstanceState);
|
|
|
62 |
}
|
|
|
63 |
}
|