Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiLostAndFound
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
MUTTINENI NAVYA
InstiLostAndFound
Commits
eafb4d7d
Commit
eafb4d7d
authored
Oct 29, 2019
by
MUTTINENI NAVYA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
individual extras to bundle
parent
2c829959
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
app/src/main/java/com/example/instilostandfound/ItemDetails.java
.../main/java/com/example/instilostandfound/ItemDetails.java
+10
-11
app/src/main/java/com/example/instilostandfound/MyPosts.java
app/src/main/java/com/example/instilostandfound/MyPosts.java
+1
-1
No files found.
app/src/main/java/com/example/instilostandfound/ItemDetails.java
View file @
eafb4d7d
...
...
@@ -3,6 +3,7 @@ package com.example.instilostandfound;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
...
...
@@ -12,20 +13,19 @@ import android.widget.TextView;
public
class
ItemDetails
extends
AppCompatActivity
implements
View
.
OnClickListener
{
String
category
,
name
,
key
;
int
type
;
Bundle
details_bundle
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_item_details
);
Intent
intent
=
getIntent
();
category
=
intent
.
getStringExtra
(
"category"
);
name
=
intent
.
getStringExtra
(
"name"
);
key
=
intent
.
getStringExtra
(
"key"
);
type
=
intent
.
getIntExtra
(
"type"
,-
1
);
details_bundle
=
intent
.
getExtras
();
TextView
cat_row
=
(
TextView
)
findViewById
(
R
.
id
.
category
);
cat_row
.
setText
(
category
);
cat_row
.
setText
(
details_bundle
.
getString
(
"category"
)
);
TextView
name_row
=
(
TextView
)
findViewById
(
R
.
id
.
name
);
name_row
.
setText
(
name
);
name_row
.
setText
(
details_bundle
.
getString
(
"name"
)
);
findViewById
(
R
.
id
.
edit_post
).
setOnClickListener
(
this
);
findViewById
(
R
.
id
.
resolve_post
).
setOnClickListener
(
this
);
...
...
@@ -35,17 +35,16 @@ int type;
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
()){
case
R
.
id
.
edit_post
:
if
(
type
==
0
){
if
(
details_bundle
.
getInt
(
"type"
)
==
0
){
Intent
intent
=
new
Intent
(
ItemDetails
.
this
,
LostItem
.
class
);
intent
.
putExtra
(
"key"
,
key
);
intent
.
putExtra
s
(
details_bundle
);
startActivity
(
intent
);
}
else
if
(
type
==
1
){
else
if
(
details_bundle
.
getInt
(
"type"
)
==
1
){
Intent
intent
=
new
Intent
(
ItemDetails
.
this
,
FoundItem
.
class
);
intent
.
putExtra
(
"key"
,
key
);
intent
.
putExtra
s
(
details_bundle
);
startActivity
(
intent
);
}
Log
.
d
(
".................."
,
"hiiiiiiiiiii"
);
break
;
case
R
.
id
.
resolve_post
:
break
;
...
...
app/src/main/java/com/example/instilostandfound/MyPosts.java
View file @
eafb4d7d
...
...
@@ -31,7 +31,7 @@ public class MyPosts extends AppCompatActivity {
intent
.
putExtra
(
"category"
,
"Electronics"
);
intent
.
putExtra
(
"name"
,
"Phone"
);
intent
.
putExtra
(
"key"
,
"123"
);
intent
.
putExtra
(
"type"
,
1
);
intent
.
putExtra
(
"type"
,
0
);
startActivity
(
intent
);
}
});
...
...
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