Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@
<activity
android:label="@string/account_add"
android:name="com.xabber.android.ui.AccountAdd"
android:theme="@style/Theme"
/>
android:theme="@style/Theme">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="xmppadd"
android:host="add_account" />
</intent-filter>
</activity>
<activity
android:label="@string/account_oauth"
android:name="com.xabber.android.ui.OAuthActivity"
Expand Down
17 changes: 16 additions & 1 deletion src/com/xabber/android/ui/AccountAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
Expand Down Expand Up @@ -85,7 +86,21 @@ protected void onCreate(Bundle savedInstanceState) {
accountTypeView.setSelection(position);
break;
}

Intent intent = getIntent();
Uri data = intent.getData();
if (data != null){
String username = data.getQueryParameter("username");
String password = data.getQueryParameter("password");
// String type = data.getQueryParameter("type");

TextView _username = (TextView) findViewById( R.id.account_user_name );
TextView _password = (TextView) findViewById( R.id.account_password );
// TextView _account_type = (TextView) findViewById( R.id.account_type );

_username.setText(username);
_password.setText(password);
// _account_type.setText(type);
}
((Button) findViewById(R.id.ok)).setOnClickListener(this);
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(findViewById(R.id.ok)
Expand Down