Commit 2c36c2a3 authored by Prakhar Agrawal's avatar Prakhar Agrawal
Browse files

Update readme.md

parent 1bf006d9
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -7,10 +7,12 @@ http://gitlab.leegality.com/leegality-public/android-sdk/blob/master/leegality.a
2. Import Leegality Library to your project by following the steps laid down in https://developer.android.com/studio/projects/android-library.html#AddDependency. 
3. To initialize signing, start activity Leegality provided by the Leegality Library. 
Pass signing URL in url key.
    <br __>Eg. `Intent intent = new Intent(getApplicationContext(), Leegality.class);
    ```
    Intent intent = new Intent(getApplicationContext(), Leegality.class);
	intent.putExtra("url", "signing-url-here");
	startActivityForResult(intent, REQUEST_CODE);
	//REQUEST_CODE is your constant, which is used to identify particular activity.`
	//REQUEST_CODE is your constant, which is used to identify particular activity.
	```

#### Note: It is recommended to start signing process by using startActivityForResult instead of startActivity to receive the response/error. 

@@ -21,8 +23,8 @@ Override method onActivityResult to check the response of signing process.
1. In case of successfully completion of signing process, signing window will be closed automatically and you will get a response with key name 'message' and corresponding 'success message' in the Intent.
2. In case of error in signing process, signing window will be closed automatically and you will get a response with key name 'error' and corresponding 'error message'.


`@Override
```
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
	//Check requestCode, If it match with the provided REQUEST_CODE then this response is for the signing process.	
	if(requestCode == REQUEST_CODE){
@@ -35,4 +37,5 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data){
		}		
	}
	super.onActivityResult(requestCode, resultCode, data);
}`
}
```