Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
6ca6a5b3
Commit
6ca6a5b3
authored
Dec 29, 2014
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactList: action null pointer exception fixed.
parent
7fc567c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
35 deletions
+37
-35
ContactList.java
app/src/main/java/com/xabber/android/ui/ContactList.java
+37
-35
No files found.
app/src/main/java/com/xabber/android/ui/ContactList.java
View file @
6ca6a5b3
...
...
@@ -208,44 +208,46 @@ public class ContactList extends ManagedActivity implements OnChoosedListener, O
@Override
protected
void
onResume
()
{
super
.
onResume
();
switch
(
action
)
{
case
ContactList
.
ACTION_ROOM_INVITE
:
case
Intent
.
ACTION_SEND
:
case
Intent
.
ACTION_CREATE_SHORTCUT
:
if
(
Intent
.
ACTION_SEND
.
equals
(
action
))
sendText
=
getIntent
().
getStringExtra
(
Intent
.
EXTRA_TEXT
);
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
select_contact
),
Toast
.
LENGTH_LONG
).
show
();
break
;
case
Intent
.
ACTION_VIEW
:
{
action
=
null
;
Uri
data
=
getIntent
().
getData
();
if
(
data
!=
null
&&
"xmpp"
.
equals
(
data
.
getScheme
()))
{
XMPPUri
xmppUri
;
try
{
xmppUri
=
XMPPUri
.
parse
(
data
);
}
catch
(
IllegalArgumentException
e
)
{
xmppUri
=
null
;
}
if
(
xmppUri
!=
null
&&
"message"
.
equals
(
xmppUri
.
getQueryType
()))
{
ArrayList
<
String
>
texts
=
xmppUri
.
getValues
(
"body"
);
String
text
=
null
;
if
(
texts
!=
null
&&
!
texts
.
isEmpty
())
text
=
texts
.
get
(
0
);
openChat
(
xmppUri
.
getPath
(),
text
);
if
(
action
!=
null
)
{
switch
(
action
)
{
case
ContactList
.
ACTION_ROOM_INVITE
:
case
Intent
.
ACTION_SEND
:
case
Intent
.
ACTION_CREATE_SHORTCUT
:
if
(
Intent
.
ACTION_SEND
.
equals
(
action
))
sendText
=
getIntent
().
getStringExtra
(
Intent
.
EXTRA_TEXT
);
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
select_contact
),
Toast
.
LENGTH_LONG
).
show
();
break
;
case
Intent
.
ACTION_VIEW
:
{
action
=
null
;
Uri
data
=
getIntent
().
getData
();
if
(
data
!=
null
&&
"xmpp"
.
equals
(
data
.
getScheme
()))
{
XMPPUri
xmppUri
;
try
{
xmppUri
=
XMPPUri
.
parse
(
data
);
}
catch
(
IllegalArgumentException
e
)
{
xmppUri
=
null
;
}
if
(
xmppUri
!=
null
&&
"message"
.
equals
(
xmppUri
.
getQueryType
()))
{
ArrayList
<
String
>
texts
=
xmppUri
.
getValues
(
"body"
);
String
text
=
null
;
if
(
texts
!=
null
&&
!
texts
.
isEmpty
())
text
=
texts
.
get
(
0
);
openChat
(
xmppUri
.
getPath
(),
text
);
}
}
break
;
}
break
;
}
case
Intent
.
ACTION_SENDTO
:
{
action
=
null
;
Uri
data
=
getIntent
().
getData
();
if
(
data
!=
null
)
{
String
path
=
data
.
getPath
(
);
if
(
path
!=
null
&&
path
.
startsWith
(
"/"
))
openChat
(
path
.
substring
(
1
),
null
)
;
case
Intent
.
ACTION_SENDTO
:
{
action
=
null
;
Uri
data
=
getIntent
().
getData
();
if
(
data
!=
null
)
{
String
path
=
data
.
getPath
();
if
(
path
!=
null
&&
path
.
startsWith
(
"/"
))
openChat
(
path
.
substring
(
1
),
null
);
}
break
;
}
break
;
}
}
if
(
Application
.
getInstance
().
doNotify
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment