Reputation: 703
I want to create an android application that opens an intent using Wifi Direct, I got this code from this link but I don't know where to put my code (calling the the application).
I tried putting in showDetails Method in WifiDirectActivity.java:
@Override
public void showDetails(WifiP2pDevice device) {
DeviceDetailFragment fragment = (DeviceDetailFragment) getFragmentManager()
.findFragmentById(R.id.frag_detail);
fragment.showDetails(device);
// Perform action on click
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.lockscreen");
startActivity(intent);
}
But still nothing happens.
Upvotes: 0
Views: 491
Reputation: 121
look into the sample code in the SDK folder and refer to the following link
http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html
Upvotes: 1