编辑:
在paypal登录后,我可以成功完成transaction.But我需要匹配paypal 中的successUrl来验证两个url是否相同然后显示成功的toast消息.
但是我没有从付款中获得成功.因此我无法与之匹配.我已经发布了相关代码:
WebActivity.java:
public class PaypalWebActivity extends Activity {
private WebView webView;
String payUrlStr;
ProgressDialog dialog;
String successUrl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.paypal_web_layout);
successUrl = LOAD_WEBVIEW_PAYMENT_PAYPAL_SUCCESS;
dialog = ProgressDialog.show(PaypalWebActivity.this, "", "Please wait..", false);
loadWebViewPaypal();
}
private void loadWebViewPaypal() {
payUrlStr = LOAD_WEBVIEW_PAYMENT_PAYPAL(PAGE_ID);
Log.e("payUrlStr", ""+payUrlStr);
webView = (WebView) findViewById(R.id.webView);
webView.loadUrl(payUrlStr);
webView.getSettings().setJavaScriptEnabled(true);
@SuppressWarnings("unused")
WebSettings settings= webView.getSettings();
if (Build.VERSION.SDK_INT >= 21) {
webView.getSettings().setMixedContentMode( WebSettings.MIXED_CONTENT_ALWAYS_ALLOW );
}
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) …Run Code Online (Sandbox Code Playgroud) 我在我的android应用程序中使用https://github.com/dlazaro66/QRCodeReaderView(QR码扫描程序)
我的主要权限如下:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus"/>
Run Code Online (Sandbox Code Playgroud)
在Gradle中我有以下代码:
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.gurkhatech.schoolmanagement"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Run Code Online (Sandbox Code Playgroud)
我已经用Java实现了代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qr);
mQrCodeReaderView = (QRCodeReaderView)findViewById(R.id.qrdecoderview);
mQrCodeReaderView.setOnQRCodeReadListener(this);
}
@Override
public void onQRCodeRead(String text, PointF[] points) {
Toast.makeText(getApplicationContext(),text,Toast.LENGTH_LONG).show();
}
@Override
public void cameraNotFound() {
}
@Override
public void QRCodeNotFoundOnCamImage() {
}
@Override
protected void onResume() {
super.onResume();
mQrCodeReaderView.getCameraManager().startPreview();
}
@Override
protected void onPause() {
super.onPause(); …Run Code Online (Sandbox Code Playgroud) 我正在尝试学习如何在应用程序中使用相机,这就是我所达到的,想法是有一个按钮打开相机,我们拍照后图片会立即显示在屏幕上,第二个按钮是从早期版本无法立即显示图片,必须单击以显示它.
无论如何我的问题是,这个代码没有显示在Android 6的图片..在我的Android 5设备上它工作正常..图片保存在"sdcard/camera_app/cam_image.jpg"路径的任何一种方式和按钮没有还没有工作,所以我在思考一下imageview已经从android 5改为6了?问题是如何使这个功能为Android 6手机
public class Add_Comment_Picture extends AppCompatActivity {
static final int CAM_REQUEST = 1;
ImageView imageView;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add__comment__picture);
button = (Button) findViewById(R.id.button);
imageView = (ImageView) findViewById(R.id.imageView);
Button button2 = (Button) findViewById(R.id.button3);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent camera_intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = getFile();
camera_intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(camera_intent , CAM_REQUEST);
}
});
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
String path = "sdcard/camera_app/cam_image.jpg";
imageView.setImageDrawable(Drawable.createFromPath(path)); …Run Code Online (Sandbox Code Playgroud)