Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97870590
RequestRefused.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jan 7, 00:19
Size
2 KB
Mime Type
text/x-java
Expires
Thu, Jan 9, 00:19 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23424518
Attached To
R3229 Genome Privacy - SHCS App
RequestRefused.java
View Options
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
package
com.example.genomicprivacy
;
import
java.util.ArrayList
;
import
FrameWork.RequestPatient
;
import
android.app.Fragment
;
import
android.graphics.Color
;
import
android.graphics.drawable.ColorDrawable
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ArrayAdapter
;
import
android.widget.ListView
;
/**
* @author Serrano Kevin
* @author Weber Jeremy
*
*/
public
class
RequestRefused
extends
Fragment
{
/**
* View for show all the refused's request
*/
private
ListView
listRefused
;
/**
* List of all the refused's request
*/
private
ArrayList
<
String
>
refusedRequest
=
new
ArrayList
<
String
>();
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
// TODO Auto-generated method stub
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_request_refused
,
container
,
false
);
listRefused
=
(
ListView
)
view
.
findViewById
(
R
.
id
.
listViewRequestRefused
);
new
GetRequestRefused
().
execute
();
return
view
;
}
/**
* Asynchronous task for retrieve from the server all the refused's request
* @author Serrano Kevin
* @author Weber Jeremy
*
*/
public
class
GetRequestRefused
extends
AsyncTask
<
Void
,
Void
,
ArrayList
<
String
>>
{
private
ArrayList
<
RequestPatient
>
allRequest
=
new
ArrayList
<
RequestPatient
>();
@Override
protected
ArrayList
<
String
>
doInBackground
(
Void
...
params
)
{
// TODO Auto-generated method stub
allRequest
=
ContextApp
.
getMu
().
checkNewRequest
();
for
(
int
i
=
0
;
i
<
allRequest
.
size
();
i
++)
{
if
(
allRequest
.
get
(
i
).
getFlag
()
==
2
)
{
refusedRequest
.
add
(
" "
+
allRequest
.
get
(
i
).
getNameTest
()
+
"\n Patient ID: "
+
allRequest
.
get
(
i
).
getId_r
());
}
}
return
refusedRequest
;
}
@Override
protected
void
onPostExecute
(
ArrayList
<
String
>
refusedRequest
)
{
// TODO Auto-generated method stub
super
.
onPostExecute
(
refusedRequest
);
if
(
refusedRequest
.
isEmpty
())
{
refusedRequest
.
add
(
"No refused request yet!"
);
}
listRefused
.
setAdapter
(
new
ArrayAdapter
<
String
>(
ContextApp
.
getContext
(),
R
.
layout
.
listitem
,
refusedRequest
));
listRefused
.
setDivider
(
new
ColorDrawable
(
Color
.
BLACK
));
listRefused
.
setDividerHeight
(
10
);
}
}
}
Event Timeline
Log In to Comment