forked from nexes/Android-File-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelpManager.java
More file actions
87 lines (71 loc) · 2.75 KB
/
HelpManager.java
File metadata and controls
87 lines (71 loc) · 2.75 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
/*
Open Manager, an open source file manager for the Android system
Copyright (C) 2009, 2010, 2011 Joe Berria <nexesdevelopment@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nexes.manager;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.TextView;
import android.widget.Button;
import android.widget.Toast;
public class HelpManager extends Activity implements OnClickListener {
private static final String[] EMAIL = {"nexesdevelopment@gmail.com"};
private static final String WEB = "http://nexesdevelopment.webs.com";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.help_layout);
String text = "Open Manager: If you have any questions or "
+"comments, please email the developer or visit "
+"the Open Manager web page.\n\nThank you\n\n";
TextView label = (TextView)findViewById(R.id.help_top_label);
label.setText(text);
Button email = (Button)findViewById(R.id.help_email_bt);
Button web = (Button)findViewById(R.id.help_website_bt);
email.setOnClickListener(this);
web.setOnClickListener(this);
}
@Override
public void onClick(View view) {
int id = view.getId();
Intent i = new Intent();
switch(id) {
case R.id.help_email_bt:
i.setAction(android.content.Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL, EMAIL);
try {
startActivity(Intent.createChooser(i, "Email using..."));
} catch(ActivityNotFoundException e) {
Toast.makeText(this, "Sorry, could not start the email", Toast.LENGTH_SHORT).show();
}
break;
case R.id.help_website_bt:
i.setAction(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse(WEB));
try {
startActivity(i);
} catch(ActivityNotFoundException e) {
Toast.makeText(this, "Sorry, could not open the website", Toast.LENGTH_SHORT).show();
}
break;
}
}
}