-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAboutUs.java
More file actions
116 lines (93 loc) · 3.62 KB
/
Copy pathAboutUs.java
File metadata and controls
116 lines (93 loc) · 3.62 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.example.trip_packer;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
public class AboutUs extends AppCompatActivity {
ImageView imgYoutube, imgInstagram, imgTelegram;
TextView txtEmail,txtemail;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_us);
startAboutUsService();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("About Us");
AppInfoFragment appInfoFragment = new AppInfoFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.app_info_fragment_container, appInfoFragment);
fragmentTransaction.commit();
imgYoutube = findViewById(R.id.imgYoutube);
imgInstagram = findViewById(R.id.imgInstagram);
imgTelegram = findViewById(R.id.imgTelegram);
txtEmail = findViewById(R.id.txtEmail);
txtemail = findViewById(R.id.txtemail);
imgYoutube.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Handle YouTube click
openUrl("https://youtube.com/@manikumarveldurthi1116?si=W8ozeUls3bQfOm23");
}
});
txtEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Handle email click
sendEmail("manikumar0459@gmail.com", "From trip packer");
}
});
txtemail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Handle email click
sendEmail("yqcbgamer@gmail.com", "From trip packer");
}
});
imgInstagram.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Handle Instagram click
openUrl("https://www.instagram.com/mr_manikumar143/");
}
});
imgTelegram.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Handle Telegram click
openUrl("https://t.me/manikumar14");
}
});
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
private void startAboutUsService() {
Intent intent = new Intent(this, AboutUsService.class);
startService(intent);
}
private void openUrl(String url) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse(url));
startActivity(intent);
}
private void sendEmail(String email, String subject) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:" + email));
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
startActivity(intent);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
}
}
}