| 21480 |
rajender |
1 |
package com.saholic.profittill.main;
|
|
|
2 |
|
|
|
3 |
import android.content.Intent;
|
|
|
4 |
import android.content.SharedPreferences;
|
|
|
5 |
import android.os.Bundle;
|
| 24857 |
tejbeer |
6 |
import android.support.v7.app.AppCompatActivity;
|
| 21480 |
rajender |
7 |
import android.view.Menu;
|
|
|
8 |
import android.view.MenuItem;
|
|
|
9 |
import android.view.View;
|
|
|
10 |
import android.widget.Button;
|
|
|
11 |
|
|
|
12 |
import com.saholic.profittill.R;
|
|
|
13 |
|
| 24857 |
tejbeer |
14 |
public class DealsHome extends AppCompatActivity {
|
| 21480 |
rajender |
15 |
Button deals,tutorials;
|
|
|
16 |
SharedPreferences userData;
|
|
|
17 |
SharedPreferences apiData;
|
|
|
18 |
|
|
|
19 |
SharedPreferences.Editor userDataEditor;
|
|
|
20 |
SharedPreferences.Editor apiSettingsEditor;
|
|
|
21 |
@Override
|
|
|
22 |
protected void onCreate(Bundle savedInstanceState) {
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
super.onCreate(savedInstanceState);
|
|
|
26 |
setContentView(R.layout.activity_deals_home);
|
|
|
27 |
getSupportActionBar().hide();
|
|
|
28 |
userData = getApplicationContext().getSharedPreferences("User_Data", MODE_PRIVATE);
|
|
|
29 |
apiData = getApplicationContext().getSharedPreferences("API_Data", MODE_PRIVATE);
|
|
|
30 |
userDataEditor = userData.edit();
|
|
|
31 |
apiSettingsEditor = apiData.edit();
|
|
|
32 |
deals = (Button)findViewById(R.id.deals);
|
|
|
33 |
tutorials = (Button)findViewById(R.id.howitworks);
|
|
|
34 |
deals.setOnClickListener(new View.OnClickListener() {
|
|
|
35 |
@Override
|
|
|
36 |
public void onClick(View v) {
|
|
|
37 |
Intent iDeals = new Intent(DealsHome.this,MainActivity.class);
|
|
|
38 |
iDeals.putExtra("landingPage",0);
|
|
|
39 |
startActivity(iDeals);
|
|
|
40 |
}
|
|
|
41 |
});
|
|
|
42 |
|
|
|
43 |
tutorials.setOnClickListener(new View.OnClickListener() {
|
|
|
44 |
@Override
|
|
|
45 |
public void onClick(View v) {
|
|
|
46 |
Intent iDeals = new Intent(DealsHome.this,MainActivity.class);
|
|
|
47 |
iDeals.putExtra("landingPage",5);
|
|
|
48 |
startActivity(iDeals);
|
|
|
49 |
}
|
|
|
50 |
});
|
|
|
51 |
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
@Override
|
|
|
56 |
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
57 |
// Inflate the menu; this adds items to the action bar if it is present.
|
|
|
58 |
getMenuInflater().inflate(R.menu.menu_deals_home, menu);
|
|
|
59 |
return true;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
@Override
|
|
|
63 |
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
64 |
// Handle action bar item clicks here. The action bar will
|
|
|
65 |
// automatically handle clicks on the Home/Up button, so long
|
|
|
66 |
// as you specify a parent activity in AndroidManifest.xml.
|
|
|
67 |
int id = item.getItemId();
|
|
|
68 |
|
|
|
69 |
//noinspection SimplifiableIfStatement
|
|
|
70 |
if (id == R.id.action_settings) {
|
|
|
71 |
return true;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
return super.onOptionsItemSelected(item);
|
|
|
75 |
}
|
|
|
76 |
}
|