From e3c7f3cf072372b2f4f29abeb6e0ecb34473cff5 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 1 Mar 2013 13:48:47 +0100 Subject: small cleanup of SendDumpFragment --- src/de/blinkt/openvpn/SendDumpFragment.java | 30 +++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'src/de') diff --git a/src/de/blinkt/openvpn/SendDumpFragment.java b/src/de/blinkt/openvpn/SendDumpFragment.java index 0ff7f48f..b33580d2 100644 --- a/src/de/blinkt/openvpn/SendDumpFragment.java +++ b/src/de/blinkt/openvpn/SendDumpFragment.java @@ -15,15 +15,15 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -public class SendDumpFragment extends Fragment implements OnClickListener { - +public class SendDumpFragment extends Fragment { + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - + View v = inflater.inflate(R.layout.fragment_senddump, container, false); v.findViewById(R.id.senddump).setOnClickListener(new OnClickListener() { - + @Override public void onClick(View v) { emailMiniDumps(); @@ -31,7 +31,7 @@ public class SendDumpFragment extends Fragment implements OnClickListener { }); return v; } - + public void emailMiniDumps() { //need to "send multiple" to get more than one attachment @@ -39,9 +39,9 @@ public class SendDumpFragment extends Fragment implements OnClickListener { emailIntent.setType("*/*"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"Arne Schwabe "}); - + String version; - String name="ics-openvpn"; + String name="ics-openvpn"; try { PackageInfo packageinfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0); version = packageinfo.versionName; @@ -49,8 +49,8 @@ public class SendDumpFragment extends Fragment implements OnClickListener { } catch (NameNotFoundException e) { version = "error fetching version"; } - - + + emailIntent.putExtra(Intent.EXTRA_SUBJECT, String.format("%s %s Minidump",name,version)); emailIntent.putExtra(Intent.EXTRA_TEXT, "Please describe the issue you have experienced"); @@ -61,7 +61,7 @@ public class SendDumpFragment extends Fragment implements OnClickListener { if(ldump==null) { OpenVPN.logError("No Minidump found!"); } - + uris.add(Uri.parse("content://de.blinkt.openvpn.FileProvider/" + ldump.getName())); uris.add(Uri.parse("content://de.blinkt.openvpn.FileProvider/" + ldump.getName() + ".log")); @@ -86,15 +86,7 @@ public class SendDumpFragment extends Fragment implements OnClickListener { // Ignore old dumps //if(System.currentTimeMillis() - 48 * 60 * 1000 > newestDumpTime ) //return null; - - return newestDumpFile; - } - - - @Override - public void onClick(View v) { - // TODO Auto-generated method stub - + return newestDumpFile; } } -- cgit v1.2.3