Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98976290
RequestPending.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
Sat, Jan 18, 04:32
Size
2 KB
Mime Type
text/x-java
Expires
Mon, Jan 20, 04:32 (2 d)
Engine
blob
Format
Raw Data
Handle
23681367
Attached To
R3229 Genome Privacy - SHCS App
RequestPending.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
RequestPending
extends
Fragment
{
/**
* View for show all the pending's request
*/
private
ListView
listPending
;
/**
* List of all the pending's request
*/
private
ArrayList
<
String
>
waitingRequest
=
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_pending
,
container
,
false
);
listPending
=
(
ListView
)
view
.
findViewById
(
R
.
id
.
listViewRequestPending
);
new
GetRequestPending
().
execute
();
return
view
;
}
/**
* Asynchronous task for retrieve from the server all the pending's request
*
* @author Serrano Kevin
* @author Weber Jeremy
*
*/
public
class
GetRequestPending
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
()
==
0
)
{
waitingRequest
.
add
(
" "
+
allRequest
.
get
(
i
).
getNameTest
()+
"\n Patient ID: "
+
allRequest
.
get
(
i
).
getId_p
());
}
}
return
waitingRequest
;
}
@Override
protected
void
onPostExecute
(
ArrayList
<
String
>
waitingRequest
)
{
// TODO Auto-generated method stub
super
.
onPostExecute
(
waitingRequest
);
listPending
.
setAdapter
(
new
ArrayAdapter
<
String
>(
ContextApp
.
getContext
(),
R
.
layout
.
listitem
,
waitingRequest
));
listPending
.
setDivider
(
new
ColorDrawable
(
Color
.
BLACK
));
listPending
.
setDividerHeight
(
10
);
}
}
}
Event Timeline
Log In to Comment