More mods for damn share stuff!

master
Chris Baughman 2014-02-09 15:25:22 -05:00
parent b031de7903
commit 5d1d559c8a
3 changed files with 21 additions and 25 deletions

View File

@ -10,3 +10,4 @@
# Project target.
target=android-19
android.library.reference.1=../../workspace/gridlayout_v7
android.library.reference.1=/storage/emulated/0/Download/android-support-v7-appcompat-master/android-support-v7-appcompat-master

View File

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Refresh -->
<group android:id="@+id/group1" android:enabled="true" android:menuCategory="container" android:visible="true">
<item android:id="@+id/settings" android:actionLayout="@layout/settings_activity" android:title="@string/action_settings" android:menuCategory="secondary" android:enabled="true" android:showAsAction="ifRoom"></item>
</group>
<!-- Location Found -->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:GoogleDorks="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_help"
android:icon="@drawable/ic_action_help"
android:title="@string/action_help"
@ -15,7 +11,7 @@
<item android:id="@+id/action_share"
android:icon="@drawable/ic_action_share"
android:title="@string/action_share"
android:showAsAction="ifRoom"
android:actionProviderClass="android.support.v7.widget.ShareActionProvider" />
GoogleDorks:showAsAction="always"
GoogleDorks:actionProviderClass="android.support.v7.widget.ShareActionProvider" />
</menu>

View File

@ -2,7 +2,10 @@ package com.cmb.googledorks;
import android.app.*;
import android.os.*;
import android.view.*;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.*;
import android.view.View.*;
import java.util.*;
@ -10,6 +13,8 @@ import android.widget.AdapterView.*;
import java.net.*;
import android.content.*;
import android.net.*;
import android.support.v4.view.*;
import android.support.v7.widget.ShareActionProvider;
public class MainActivity extends Activity
{
@ -25,11 +30,9 @@ public class MainActivity extends Activity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflator = getMenuInflater();
inflator.inflate(R.menu.menu, menu);
// Set up shareactionprovider
getMenuInflater().inflate(R.menu.menu, menu);
MenuItem shareItem = menu.findItem(R.id.action_share);
mShare = (ShareActionProvider)shareItem.getActionProvider();
mShare = (android.support.v7.widget.ShareActionProvider)MenuItemCompat.getActionProvider(shareItem);
mShare.setShareIntent(getShareItem());
return super.onCreateOptionsMenu(menu);
}
@ -88,14 +91,16 @@ public class MainActivity extends Activity
});
listV.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> arg0, View view,
int pos, long arg3) {
dorkSelected = list.get(pos).toString();
return false;
Intent inten = new Intent(Intent.ACTION_SEND);
inten.putExtra(Intent.EXTRA_TEXT, dorkSelected);
inten.setType("text/plain");
setShareIntent(inten);
return false;
}
});
listV.setOnItemClickListener(new OnItemClickListener() {
@ -124,11 +129,6 @@ public class MainActivity extends Activity
public boolean onOptionsItemSelected(MenuItem item) {
// Take appropriate action for each action item click
switch (item.getItemId()) {
case R.id.settings:
// search action
Intent intent_settings = new Intent(this, SettingsActivity.class);
this.startActivity(intent_settings);
return true;
case R.id.action_help:
// location found
ShowHelp sh = new ShowHelp(this);
@ -156,9 +156,8 @@ public class MainActivity extends Activity
private Intent getShareItem() {
Intent inten = new Intent(Intent.ACTION_SEND);
inten.putExtra(Intent.EXTRA_TEXT, dorkSelected);
inten.setType("text/plain");
inten.setType("image/*");
return inten;
}
}