-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainActivity.java
91 lines (75 loc) · 3.2 KB
/
MainActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package com.example.codepredators.myapplication;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.view.menu.MenuView;
import android.view.View;
import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
ImageView view_my_task;
ImageView freshchat;
ImageView freshdesk;
ImageView admob;
ImageView Flipkart;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
view_my_task = findViewById(R.id.view_my_task);
freshchat = findViewById(R.id.freshchat);
freshdesk = findViewById(R.id.freshdesk);
admob = findViewById(R.id.admob);
Flipkart = findViewById(R.id.Flipkart);
view_my_task.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Fragment mFragment = null;
mFragment = new MyTaskFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frameLayout, mFragment).commit();
}
});
freshchat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Fragment mFragment = null;
mFragment = new FreshchatFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frameLayout, mFragment).commit();
}
});
freshdesk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Fragment mFragment = null;
mFragment = new FreshdeskFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frameLayout, mFragment).commit();
}
});
admob.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Fragment mFragment = null;
mFragment = new AdmobFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frameLayout, mFragment).commit();
}
});
Flipkart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Fragment mFragment = null;
mFragment = new FlipkartFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frameLayout, mFragment).commit();
}
});
}
}