我正在尝试运行此服务
class PptpService extends VpnService<PptpProfile> {
@Override
protected void connect(String serverIp, String username, String password) throws IOException {
PptpProfile p = getProfile();
getDaemons().startPptp(serverIp, username, password, p.isEncryptionEnabled());
}
}
谁能帮我吗?我试过这个但没有运气。
Intent intent = new Intent(this, PptpService.class);
startService(intent);
首先将您的服务添加到Manifest:
<service android:name=".VpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService"/>
</intent-filter>